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

Function mapTrelloAction

apps/sim/tools/trello/shared.ts:209–227  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

207}
208
209export function mapTrelloAction(value: unknown): TrelloAction {
210 if (!isRecordLike(value)) {
211 throw new Error('Trello returned an invalid action object')
212 }
213
214 const data = isRecordLike(value.data) ? value.data : null
215
216 return {
217 id: getRequiredString(value.id, 'id'),
218 type: getRequiredString(value.type, 'type'),
219 date: getRequiredString(value.date, 'date'),
220 idMemberCreator: getRequiredString(value.idMemberCreator, 'idMemberCreator'),
221 text: data ? getOptionalString(data.text) : null,
222 memberCreator: mapTrelloMember(value.memberCreator),
223 card: data ? mapActionCardTarget(data.card) : null,
224 board: data ? mapActionBoardTarget(data.board) : null,
225 list: data ? mapActionListTarget(data.list) : null,
226 }
227}
228
229export function mapTrelloComment(value: unknown): TrelloComment {
230 return mapTrelloAction(value)

Callers 2

get_actions.tsFile · 0.90
mapTrelloCommentFunction · 0.85

Calls 7

isRecordLikeFunction · 0.90
getRequiredStringFunction · 0.85
getOptionalStringFunction · 0.85
mapTrelloMemberFunction · 0.85
mapActionCardTargetFunction · 0.85
mapActionBoardTargetFunction · 0.85
mapActionListTargetFunction · 0.85

Tested by

no test coverage detected