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

Function validateMondayNumericId

apps/sim/lib/core/security/input-validation.ts:1297–1322  ·  view source on GitHub ↗
(
  value: string | number | null | undefined,
  paramName = 'ID'
)

Source from the content-addressed store, hash-verified

1295 * ```
1296 */
1297export function validateMondayNumericId(
1298 value: string | number | null | undefined,
1299 paramName = 'ID'
1300): ValidationResult {
1301 if (value === null || value === undefined || value === '') {
1302 return {
1303 isValid: false,
1304 error: `${paramName} is required`,
1305 }
1306 }
1307
1308 const str = String(value).trim()
1309
1310 if (!/^\d+$/.test(str)) {
1311 logger.warn('Monday.com ID is not a valid numeric integer', {
1312 paramName,
1313 value: str.substring(0, 50),
1314 })
1315 return {
1316 isValid: false,
1317 error: `${paramName} must be a numeric integer`,
1318 }
1319 }
1320
1321 return { isValid: true, sanitized: str }
1322}
1323
1324/**
1325 * Validates a Monday.com group ID.

Callers 5

sanitizeNumericIdFunction · 0.90
createSubscriptionFunction · 0.90
deleteSubscriptionFunction · 0.90
route.tsFile · 0.90

Calls 2

testMethod · 0.80
warnMethod · 0.65

Tested by

no test coverage detected