Repository navigation
Expand file tree
/
Copy pathdashboard.ts
More file actions
172 lines (149 loc) · 4.22 KB
/
Copy pathdashboard.ts
File metadata and controls
172 lines (149 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// types/dashboard.ts
import type { ContributionCalendar, GraphNode, GraphLink } from './index';
export interface UserProfile {
username: string;
name: string;
avatarUrl: string;
isPro: boolean;
bio: string;
location: string;
joinedDate: string;
developerScore: number;
type?: 'User' | 'Organization'; // Added to distinguish orgs from standard users
stats: {
repositories: number;
followers: number;
following: number; // For Organizations, this acts as the "members" count
stars: number;
};
}
export interface ActivityData {
date: string;
count: number;
intensity: 0 | 1 | 2 | 3 | 4; // 0 = no activity, 4 = highest
// Added for LoC (Lines of Code) Mode tracking
locAdditions?: number;
locDeletions?: number;
}
export interface UserStats {
currentStreak: number;
peakStreak: number;
totalContributions: number;
}
export interface LanguageData {
name: string;
color: string;
percentage: number;
}
export interface AIInsight {
id: string;
icon: string;
text: string;
}
export interface Achievement {
id: string;
title: string;
description: string;
icon: string;
isUnlocked: boolean;
type: 'contributions' | 'streak' | 'behavior';
threshold: number;
currentValue: number;
progress: number; // 0–100
}
export interface HallOfFameAward {
category: 'active' | 'growing' | 'collaborative' | 'popular' | 'contributed';
title: string;
repoName: string;
repoAvatar?: string;
description: string;
centerpieceLabel: string;
centerpieceValue: string | number;
bottomStats: string;
explanation: string;
icon: string;
url: string;
}
export interface CommitClockData {
day: string; // 'Sun' | 'Mon' | 'Tue' | 'Wed' | 'Thu' | 'Fri' | 'Sat'
commits: number;
}
export interface DashboardExportData {
stats: UserStats;
languages: LanguageData[];
activity?: ActivityData[];
}
/* ==========================================================================
* NEW EPIC FEATURE TYPES (Wrapped & Org Data)
* ========================================================================== */
export interface WrappedStats {
totalContributions: number;
mostActiveDate: string;
highestDailyCount: number;
busiestMonth: string;
weekendRatio: number;
topLanguage: string;
calendar: ContributionCalendar;
longestStreak?: number;
previousYearContributions?: number;
contributionGrowth?: number;
mostActiveRepos?: Array<{ name: string; commits: number }>;
primaryLanguages?: Array<{ name: string; percentage: number; color: string }>;
milestones?: Array<{ name: string; description: string; unlocked: boolean }>;
mostProductiveDay?: string;
mostActiveHour?: number;
}
export interface OrgDashboardData {
profile: UserProfile;
stats: UserStats;
calendar: ContributionCalendar;
individualCalendars?: { user: string; calendar: ContributionCalendar }[];
}
export interface Repository {
name: string;
description: string | null;
stargazerCount: number;
forkCount: number;
url: string;
primaryLanguage: {
name: string;
color: string;
} | null;
}
export interface RepoActivityInfo {
name: string;
url: string;
pushedAt: string | null;
}
/* ==========================================================================
* PRODUCTION DEPLOYMENTS FEATURE
* ========================================================================== */
export type WorkflowStatus = 'success' | 'failure' | 'in_progress' | 'unknown';
export interface DeploymentData {
repoName: string;
repoUrl: string;
liveUrl: string | null;
status: WorkflowStatus;
deployedAt: string | null; // ISO timestamp of the deployment
environment: string; // e.g. "production"
workflowName: string | null; // e.g. "Vercel Production Deployment"
}
export interface DashboardData {
profile: UserProfile;
stats: UserStats;
languages: LanguageData[];
activity: ActivityData[];
insights: AIInsight[];
achievements: Achievement[];
commitClock: CommitClockData[];
graphData: {
nodes: GraphNode[];
links: GraphLink[];
};
popularRepos?: Repository[];
pinnedRepos?: Repository[];
starredRepos?: Repository[];
deployments?: DeploymentData[];
hallOfFame?: HallOfFameAward[];
rawCommits?: string[]; // Raw ISO timestamps of recent commits for accurate hourly pulse
}