leetcode-fetcher-cli
Version:
A CLi Application for local fetching of leetcode problems
141 lines (133 loc) • 2.64 kB
text/typescript
const userPublicProfile = `#graphql
query userPublicProfile($username: String!) {
matchedUser(username: $username) {
contestBadge {
name
expired
hoverText
icon
}
username
githubUrl
twitterUrl
linkedinUrl
profile {
ranking
userAvatar
realName
aboutMe
school
websites
countryName
company
jobTitle
skillTags
postViewCount
postViewCountDiff
reputation
reputationDiff
solutionCount
solutionCountDiff
categoryDiscussCount
categoryDiscussCountDiff
}
submitStats {
totalSubmissionNum {
difficulty
count
submissions
}
acSubmissionNum {
difficulty
count
submissions
}
}
}
}
`
const languageStats = `#graphql
query languageStats($username: String!) {
matchedUser(username: $username) {
languageProblemCount {
languageName
problemsSolved
}
}
}
`
const userProblemSolved = `#graphql
query userProblemsSolved($username: String!) {
allQuestionsCount {
difficulty
count
}
matchedUser(username: $username) {
problemsSolvedBeatsStats {
difficulty
percentage
}
submitStatsGlobal {
acSubmissionNum {
difficulty
count
}
}
}
}
`
// AC means accepted
const recentAcSubmissions = `#graphql
query recentAcSubmissions($username: String!, $limit: Int!) {
recentAcSubmissionList(username: $username, limit: $limit) {
id
title
titleSlug
timestamp
statusDisplay
lang
}
}
`
const recentSubmissions = `#graphql
query recentSubmissions($username: String!, $limit: Int) {
recentSubmissionList(username: $username, limit: $limit) {
id
title
titleSlug
timestamp
statusDisplay
lang
}
}`
const userStatus = `#graphql
query globalData {
userStatus {
userId
isSignedIn
isMockUser
isPremium
isVerified
username
avatar
isAdmin
isSuperuser
permissions
isTranslator
activeSessionId
checkedInToday
notificationStatus {
lastModified
numUnread
}
}
}`;
const userql: Record<string, string> = {
userPublicProfile : userPublicProfile,
languageStats : languageStats,
userProblemSolved : userProblemSolved,
recentAcSubmissions : recentAcSubmissions,
recentSubmissions : recentSubmissions,
userStatus : userStatus
};
export default userql;