MCPcopy Index your code
hub / github.com/cameri/nostream / validateSettings

Function validateSettings

src/cli/utils/config.ts:393–420  ·  view source on GitHub ↗
(settings: Settings)

Source from the content-addressed store, hash-verified

391}
392
393export const validateSettings = (settings: Settings): ValidationIssue[] => {
394 const issues: ValidationIssue[] = []
395
396 if (!settings.info?.relay_url) {
397 issues.push({ path: 'info.relay_url', message: 'relay_url is required' })
398 }
399
400 if (!settings.info?.name) {
401 issues.push({ path: 'info.name', message: 'name is required' })
402 }
403
404 if (!settings.network) {
405 issues.push({ path: 'network', message: 'network section is required' })
406 }
407
408 if (settings.payments?.enabled && !settings.payments.processor) {
409 issues.push({ path: 'payments.processor', message: 'processor is required when payments are enabled' })
410 }
411
412 const strategy = settings.limits?.rateLimiter?.strategy
413 if (strategy && strategy !== 'ewma' && strategy !== 'sliding_window') {
414 issues.push({ path: 'limits.rateLimiter.strategy', message: 'strategy must be ewma or sliding_window' })
415 }
416
417 validateShape(loadDefaults(), settings, [], issues)
418
419 return issues
420}

Callers 3

config.spec.tsFile · 0.90
runConfigSetFunction · 0.90
runConfigValidateFunction · 0.90

Calls 2

validateShapeFunction · 0.85
loadDefaultsFunction · 0.85

Tested by

no test coverage detected