MCPcopy Index your code
hub / github.com/gitify-app/gitify / transformNotification

Function transformNotification

src/renderer/utils/api/transform.ts:45–60  ·  view source on GitHub ↗

* Transform a raw GitHub notification to GitifyNotification. * Called immediately after REST API response is received. * * This is the ONLY place where raw GitHub types should be converted * to Gitify's internal notification type. * * @param raw - The GitHub notification. * @param account - T

(
  raw: RawGitHubNotification,
  account: Account,
)

Source from the content-addressed store, hash-verified

43 * @returns A transformed Gitify notification.
44 */
45function transformNotification(
46 raw: RawGitHubNotification,
47 account: Account,
48): GitifyNotification {
49 return {
50 id: raw.id,
51 unread: raw.unread,
52 updatedAt: raw.updated_at,
53 reason: transformReason(raw.reason),
54 subject: transformSubject(raw.subject),
55 repository: transformRepository(raw.repository),
56 account: account,
57 order: 0, // Will be set later in stabilizeNotificationsOrder
58 display: undefined as unknown as GitifyNotificationDisplay, // Display fields start as undefined, populated by formatNotification post-enrichment
59 };
60}
61
62function transformReason(raw: RawGitHubNotification['reason']): GitifyReason {
63 const reasonDetails = getReasonDetails(raw as Reason);

Callers 1

transformNotificationsFunction · 0.85

Calls 3

transformReasonFunction · 0.85
transformSubjectFunction · 0.85
transformRepositoryFunction · 0.85

Tested by

no test coverage detected