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

Function mapHistoryEvent

apps/sim/tools/temporal/utils.ts:243–251  ·  view source on GitHub ↗
(event: TemporalRawHistoryEvent)

Source from the content-addressed store, hash-verified

241 * object (each event carries exactly one, keyed by its type).
242 */
243export function mapHistoryEvent(event: TemporalRawHistoryEvent) {
244 const attributesKey = Object.keys(event).find((key) => key.endsWith('EventAttributes'))
245 return {
246 eventId: event.eventId != null ? Number(event.eventId) : null,
247 eventTime: event.eventTime ?? null,
248 eventType: stripEnumPrefix(event.eventType, 'EVENT_TYPE_'),
249 attributes: attributesKey ? ((event[attributesKey] as Record<string, unknown>) ?? null) : null,
250 }
251}
252
253/**
254 * Parses a Temporal HTTP API response body and throws a descriptive error for non-2xx

Callers

nothing calls this directly

Calls 1

stripEnumPrefixFunction · 0.85

Tested by

no test coverage detected