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

Function normalizeVantaPerson

apps/sim/tools/vanta/utils.ts:536–577  ·  view source on GitHub ↗
(resource: JsonRecord)

Source from the content-addressed store, hash-verified

534}
535
536export function normalizeVantaPerson(resource: JsonRecord): VantaPerson {
537 const name = isRecordLike(resource.name)
538 ? {
539 first: getString(resource.name.first),
540 last: getString(resource.name.last),
541 display: getString(resource.name.display),
542 }
543 : null
544 const employment = isRecordLike(resource.employment)
545 ? {
546 status: getString(resource.employment.status),
547 startDate: getString(resource.employment.startDate),
548 endDate: getString(resource.employment.endDate),
549 jobTitle: getString(resource.employment.jobTitle),
550 }
551 : null
552 const leaveInfo = isRecordLike(resource.leaveInfo)
553 ? {
554 status: getString(resource.leaveInfo.status),
555 startDate: getString(resource.leaveInfo.startDate),
556 endDate: getString(resource.leaveInfo.endDate),
557 }
558 : null
559 const tasksSummary = isRecordLike(resource.tasksSummary)
560 ? {
561 status: getString(resource.tasksSummary.status),
562 dueDate: getString(resource.tasksSummary.dueDate),
563 completionDate: getString(resource.tasksSummary.completionDate),
564 }
565 : null
566
567 return {
568 id: getString(resource.id),
569 userId: getString(resource.userId),
570 emailAddress: getString(resource.emailAddress),
571 name,
572 employment,
573 leaveInfo,
574 groupIds: getStringArray(resource.groupIds),
575 tasksSummary,
576 }
577}
578
579function normalizeVantaPolicyDocument(resource: JsonRecord): VantaPolicyDocument {
580 return {

Callers 1

buildVantaOutputFunction · 0.90

Calls 3

isRecordLikeFunction · 0.90
getStringFunction · 0.70
getStringArrayFunction · 0.70

Tested by

no test coverage detected