@stats-organization/github-readme-stats-core 2.1.5 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api/gist.d.ts +2 -7
- package/build/api/gist.d.ts.map +1 -1
- package/build/api/gist.js +9 -41
- package/build/api/index.d.ts +3 -8
- package/build/api/index.d.ts.map +1 -1
- package/build/api/index.js +23 -45
- package/build/api/pin.d.ts +2 -7
- package/build/api/pin.d.ts.map +1 -1
- package/build/api/pin.js +9 -41
- package/build/api/top-langs.d.ts +2 -7
- package/build/api/top-langs.d.ts.map +1 -1
- package/build/api/top-langs.js +11 -55
- package/build/api/wakatime.d.ts +2 -7
- package/build/api/wakatime.d.ts.map +1 -1
- package/build/api/wakatime.js +9 -41
- package/build/cards/common-options.d.ts +13 -0
- package/build/cards/common-options.d.ts.map +1 -0
- package/build/cards/common-options.js +1 -0
- package/build/cards/gist.d.ts +11 -16
- package/build/cards/gist.d.ts.map +1 -1
- package/build/cards/gist.js +26 -31
- package/build/cards/repo.d.ts +19 -16
- package/build/cards/repo.d.ts.map +1 -1
- package/build/cards/repo.js +58 -60
- package/build/cards/stats.d.ts +29 -46
- package/build/cards/stats.d.ts.map +1 -1
- package/build/cards/stats.js +113 -181
- package/build/cards/top-languages.d.ts +81 -77
- package/build/cards/top-languages.d.ts.map +1 -1
- package/build/cards/top-languages.js +174 -200
- package/build/cards/wakatime.d.ts +21 -11
- package/build/cards/wakatime.d.ts.map +1 -1
- package/build/cards/wakatime.js +73 -111
- package/build/common/Card.d.ts +34 -13
- package/build/common/Card.d.ts.map +1 -1
- package/build/common/Card.js +73 -40
- package/build/common/I18n.d.ts +4 -2
- package/build/common/I18n.d.ts.map +1 -1
- package/build/common/color.d.ts +60 -18
- package/build/common/color.d.ts.map +1 -1
- package/build/common/color.js +102 -5
- package/build/common/config.d.ts +2 -1
- package/build/common/config.d.ts.map +1 -1
- package/build/common/config.js +16 -26
- package/build/common/constants.d.ts +2 -1
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/date.d.ts +37 -0
- package/build/common/date.d.ts.map +1 -0
- package/build/common/date.js +31 -0
- package/build/common/http.d.ts +25 -2
- package/build/common/http.d.ts.map +1 -1
- package/build/common/http.js +26 -3
- package/build/common/icons.d.ts +1 -0
- package/build/common/icons.d.ts.map +1 -1
- package/build/common/icons.js +1 -0
- package/build/common/languageColors.d.ts +11 -0
- package/build/common/languageColors.d.ts.map +1 -0
- package/build/common/languageColors.js +15 -0
- package/build/common/languageColors.json +1 -0
- package/build/common/ops.d.ts +3 -10
- package/build/common/ops.d.ts.map +1 -1
- package/build/common/ops.js +3 -15
- package/build/common/render.d.ts +43 -6
- package/build/common/render.d.ts.map +1 -1
- package/build/common/render.js +77 -11
- package/build/common/retryer.d.ts +3 -2
- package/build/common/retryer.d.ts.map +1 -1
- package/build/common/retryer.js +1 -0
- package/build/fetchers/gist.d.ts.map +1 -1
- package/build/fetchers/gist.js +8 -39
- package/build/fetchers/repo.d.ts +12 -11
- package/build/fetchers/repo.d.ts.map +1 -1
- package/build/fetchers/repo.js +26 -67
- package/build/fetchers/stats.d.ts +24 -17
- package/build/fetchers/stats.d.ts.map +1 -1
- package/build/fetchers/stats.js +302 -183
- package/build/fetchers/top-languages.d.ts +10 -15
- package/build/fetchers/top-languages.d.ts.map +1 -1
- package/build/fetchers/top-languages.js +52 -103
- package/build/fetchers/types.d.ts +24 -20
- package/build/fetchers/types.d.ts.map +1 -1
- package/build/fetchers/wakatime.d.ts +9 -5
- package/build/fetchers/wakatime.d.ts.map +1 -1
- package/build/fetchers/wakatime.js +8 -4
- package/build/graphql/contributionsDocument.d.ts +18 -0
- package/build/graphql/contributionsDocument.d.ts.map +1 -0
- package/build/graphql/contributionsDocument.js +30 -0
- package/build/graphql/generated/common.d.ts +42 -0
- package/build/graphql/generated/common.d.ts.map +1 -0
- package/build/graphql/generated/common.js +2 -0
- package/build/graphql/generated/gist.d.ts +44 -0
- package/build/graphql/generated/gist.d.ts.map +1 -0
- package/build/graphql/generated/gist.js +27 -0
- package/build/graphql/generated/repo.d.ts +67 -0
- package/build/graphql/generated/repo.d.ts.map +1 -0
- package/build/graphql/generated/repo.js +30 -0
- package/build/graphql/generated/stats.d.ts +150 -0
- package/build/graphql/generated/stats.d.ts.map +1 -0
- package/build/graphql/generated/stats.js +95 -0
- package/build/graphql/generated/top-languages.d.ts +54 -0
- package/build/graphql/generated/top-languages.d.ts.map +1 -0
- package/build/graphql/generated/top-languages.js +27 -0
- package/build/graphql/graphqlDocument.d.ts +22 -0
- package/build/graphql/graphqlDocument.d.ts.map +1 -0
- package/build/graphql/graphqlDocument.js +8 -0
- package/build/graphql/reposContributedToDocument.d.ts +27 -0
- package/build/graphql/reposContributedToDocument.d.ts.map +1 -0
- package/build/graphql/reposContributedToDocument.js +59 -0
- package/build/index.d.ts +3 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -1
- package/build/themes/index.d.ts +32 -0
- package/build/themes/index.d.ts.map +1 -1
- package/build/themes/index.js +28 -0
- package/build/translations.d.ts +17 -0
- package/build/translations.d.ts.map +1 -1
- package/build/translations.js +17 -0
- package/package.json +13 -7
- package/src/_github-username-regex.d.ts +4 -0
- package/src/api/gist.js +10 -46
- package/src/api/index.js +30 -51
- package/src/api/pin.js +10 -46
- package/src/api/top-langs.js +13 -60
- package/src/api/wakatime.js +10 -46
- package/src/cards/common-options.ts +13 -0
- package/src/cards/{gist.js → gist.ts} +37 -37
- package/src/cards/{repo.js → repo.ts} +86 -68
- package/src/cards/{stats.js → stats.ts} +168 -219
- package/src/cards/{top-languages.js → top-languages.ts} +309 -265
- package/src/cards/{wakatime.js → wakatime.ts} +136 -130
- package/src/common/Card.ts +94 -49
- package/src/common/I18n.ts +6 -2
- package/src/common/color.ts +163 -14
- package/src/common/config.ts +22 -29
- package/src/common/constants.ts +3 -1
- package/src/common/date.ts +45 -0
- package/src/common/http.ts +43 -3
- package/src/common/icons.ts +1 -0
- package/src/common/languageColors.json +1 -0
- package/src/common/languageColors.ts +19 -0
- package/src/common/ops.ts +8 -18
- package/src/common/render.ts +114 -14
- package/src/common/retryer.ts +6 -5
- package/src/fetchers/gist.ts +15 -72
- package/src/fetchers/repo.ts +114 -0
- package/src/fetchers/stats.ts +743 -0
- package/src/fetchers/top-languages.ts +135 -0
- package/src/fetchers/types.ts +28 -20
- package/src/fetchers/{wakatime.js → wakatime.ts} +19 -5
- package/src/graphql/contributionsDocument.ts +44 -0
- package/src/graphql/generated/common.ts +26 -0
- package/src/graphql/generated/gist.ts +59 -0
- package/src/graphql/generated/repo.ts +90 -0
- package/src/graphql/generated/stats.ts +194 -0
- package/src/graphql/generated/top-languages.ts +75 -0
- package/src/graphql/graphqlDocument.ts +25 -0
- package/src/graphql/queries/gist.graphql +25 -0
- package/src/graphql/queries/repo.graphql +28 -0
- package/src/graphql/queries/stats.graphql +120 -0
- package/src/graphql/queries/top-languages.graphql +34 -0
- package/src/graphql/reposContributedToDocument.ts +86 -0
- package/src/index.ts +3 -1
- package/src/themes/index.ts +33 -0
- package/src/translations.ts +17 -0
- package/src/cards/types.d.ts +0 -78
- package/src/fetchers/repo.js +0 -161
- package/src/fetchers/stats.js +0 -473
- package/src/fetchers/top-languages.js +0 -175
- package/src/themes/README.md +0 -229
|
@@ -1,138 +1,87 @@
|
|
|
1
1
|
import { getConfig } from "../common/config.js";
|
|
2
2
|
import { CustomError, MissingParamError } from "../common/error.js";
|
|
3
3
|
import { wrapTextMultiline } from "../common/fmt.js";
|
|
4
|
-
import {
|
|
4
|
+
import { createGraphQLFetcher } from "../common/http.js";
|
|
5
5
|
import { logger } from "../common/log.js";
|
|
6
6
|
import { parseOwnerAffiliations } from "../common/ops.js";
|
|
7
7
|
import { retryer } from "../common/retryer.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
* @param {any} variables Fetcher variables.
|
|
12
|
-
* @param {string} token GitHub token.
|
|
13
|
-
* @returns {Promise<import("axios").AxiosResponse>} Languages fetcher response.
|
|
14
|
-
*/
|
|
15
|
-
const fetcher = (variables, token) => {
|
|
16
|
-
return request({
|
|
17
|
-
query: `
|
|
18
|
-
query userInfo($login: String!, $ownerAffiliations: [RepositoryAffiliation]) {
|
|
19
|
-
user(login: $login) {
|
|
20
|
-
# do not fetch forks
|
|
21
|
-
repositories(ownerAffiliations: $ownerAffiliations, isFork: false, first: 100) {
|
|
22
|
-
nodes {
|
|
23
|
-
name
|
|
24
|
-
languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
|
|
25
|
-
edges {
|
|
26
|
-
size
|
|
27
|
-
node {
|
|
28
|
-
color
|
|
29
|
-
name
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
`,
|
|
38
|
-
variables,
|
|
39
|
-
}, {
|
|
40
|
-
Authorization: `token ${token}`,
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* @typedef {import("./types").TopLangData} TopLangData Top languages data.
|
|
45
|
-
*/
|
|
8
|
+
import { TopLanguagesDocument } from "../graphql/generated/top-languages.js";
|
|
9
|
+
const fetcher = createGraphQLFetcher(TopLanguagesDocument, "token");
|
|
46
10
|
/**
|
|
47
11
|
* Fetch top languages for a given username.
|
|
48
12
|
*
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @returns
|
|
13
|
+
* @param username GitHub username.
|
|
14
|
+
* @param exclude_repo List of repositories to exclude. Default: [].
|
|
15
|
+
* @param size_weight Weightage to be given to size.
|
|
16
|
+
* @param count_weight Weightage to be given to count.
|
|
17
|
+
* @param ownerAffiliations The owner affiliations to filter by. Default: OWNER.
|
|
18
|
+
* @param pat Optional PAT override.
|
|
19
|
+
* @returns Top languages data.
|
|
56
20
|
*/
|
|
57
21
|
const fetchTopLanguages = async (username, exclude_repo = [], size_weight = 1, count_weight = 0, ownerAffiliations = [], pat = null) => {
|
|
58
22
|
if (!username) {
|
|
59
23
|
throw new MissingParamError(["username"]);
|
|
60
24
|
}
|
|
61
|
-
|
|
25
|
+
const affiliations = parseOwnerAffiliations(ownerAffiliations);
|
|
62
26
|
const res = await retryer(fetcher, {
|
|
63
27
|
login: username,
|
|
64
|
-
ownerAffiliations,
|
|
28
|
+
ownerAffiliations: affiliations,
|
|
65
29
|
}, pat);
|
|
66
30
|
if (res.data.errors) {
|
|
67
31
|
logger.error(res.data.errors);
|
|
68
|
-
|
|
69
|
-
|
|
32
|
+
const firstError = res.data.errors[0];
|
|
33
|
+
if (firstError?.type === "NOT_FOUND") {
|
|
34
|
+
throw new CustomError(firstError.message || "Could not fetch user.", CustomError.USER_NOT_FOUND);
|
|
70
35
|
}
|
|
71
|
-
if (
|
|
72
|
-
throw new CustomError(wrapTextMultiline(
|
|
36
|
+
if (firstError?.message) {
|
|
37
|
+
throw new CustomError(wrapTextMultiline(firstError.message, 525, 12)[0] ?? "", res.statusText);
|
|
73
38
|
}
|
|
74
39
|
throw new CustomError("Something went wrong while trying to retrieve the language data using the GraphQL API.", CustomError.GRAPHQL_ERROR);
|
|
75
40
|
}
|
|
76
|
-
|
|
77
|
-
/** @type {Record<string, boolean>} */
|
|
78
|
-
let repoToHide = {};
|
|
41
|
+
const repoToHide = {};
|
|
79
42
|
const allExcludedRepos = [
|
|
80
43
|
...exclude_repo,
|
|
81
44
|
...getConfig().excludeRepositories,
|
|
82
45
|
];
|
|
83
|
-
// populate repoToHide map for quick lookup
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
repoToHide[repoName] = true;
|
|
88
|
-
});
|
|
89
|
-
}
|
|
46
|
+
// populate repoToHide map for quick lookup while filtering out
|
|
47
|
+
allExcludedRepos.forEach((repoName) => {
|
|
48
|
+
repoToHide[repoName] = true;
|
|
49
|
+
});
|
|
90
50
|
// filter out repositories to be hidden
|
|
91
|
-
repoNodes =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
//
|
|
104
|
-
|
|
105
|
-
if (
|
|
106
|
-
langSize =
|
|
107
|
-
repoCount
|
|
51
|
+
const repoNodes = (res.data.data.user?.repositories.nodes ?? []).filter((node) => !!node && !repoToHide[node.name]);
|
|
52
|
+
// flatten edges across repos. Order matters: `concat(acc)` prepends, and the
|
|
53
|
+
// shared repoCount below depends on visitation order.
|
|
54
|
+
const languageEdges = repoNodes.reduce((acc, repo) => {
|
|
55
|
+
const edges = (repo.languages?.edges ?? []).filter((edge) => !!edge);
|
|
56
|
+
return edges.length > 0 ? edges.concat(acc) : acc;
|
|
57
|
+
}, []);
|
|
58
|
+
// accumulate size and repo count per language
|
|
59
|
+
const languageMap = {};
|
|
60
|
+
let repoCount;
|
|
61
|
+
for (const edge of languageEdges) {
|
|
62
|
+
const existing = languageMap[edge.node.name];
|
|
63
|
+
// same language seen again: add to its size and bump count; else reset to 1
|
|
64
|
+
let langSize = edge.size;
|
|
65
|
+
if (existing && edge.node.name === existing.name) {
|
|
66
|
+
langSize = edge.size + existing.size;
|
|
67
|
+
repoCount = existing.count + 1;
|
|
108
68
|
}
|
|
109
69
|
else {
|
|
110
|
-
// reset repoCount to 1
|
|
111
|
-
// language must exist in at least one repo to be detected
|
|
112
70
|
repoCount = 1;
|
|
113
71
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
size: langSize,
|
|
120
|
-
count: repoCount,
|
|
121
|
-
},
|
|
72
|
+
languageMap[edge.node.name] = {
|
|
73
|
+
name: edge.node.name,
|
|
74
|
+
color: edge.node.color,
|
|
75
|
+
size: langSize,
|
|
76
|
+
count: repoCount,
|
|
122
77
|
};
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
Math.pow(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
.sort((a, b) => repoNodes[b].size - repoNodes[a].size)
|
|
132
|
-
.reduce((result, key) => {
|
|
133
|
-
result[key] = repoNodes[key];
|
|
134
|
-
return result;
|
|
135
|
-
}, {});
|
|
136
|
-
return topLangs;
|
|
78
|
+
}
|
|
79
|
+
// comparison index calculation
|
|
80
|
+
for (const lang of Object.values(languageMap)) {
|
|
81
|
+
lang.size =
|
|
82
|
+
Math.pow(lang.size, size_weight) * Math.pow(lang.count, count_weight);
|
|
83
|
+
}
|
|
84
|
+
// return languages sorted by (weighted) size, descending
|
|
85
|
+
return Object.fromEntries(Object.entries(languageMap).sort(([, a], [, b]) => b.size - a.size));
|
|
137
86
|
};
|
|
138
87
|
export { fetchTopLanguages };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RepoInfoFragment } from "../graphql/generated/repo.js";
|
|
1
2
|
export interface GistData {
|
|
2
3
|
name: string;
|
|
3
4
|
nameWithOwner: string;
|
|
@@ -6,27 +7,25 @@ export interface GistData {
|
|
|
6
7
|
starsCount: number;
|
|
7
8
|
forksCount: number;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
isTemplate: boolean;
|
|
15
|
-
stargazerCount: number;
|
|
16
|
-
description: string;
|
|
10
|
+
/**
|
|
11
|
+
* What the repo query returns, with `primaryLanguage` loosened:
|
|
12
|
+
* the schema says `name` is non-null, but the card falls back to defaults for callers passing untyped data.
|
|
13
|
+
*/
|
|
14
|
+
type RepoInfo = Omit<RepoInfoFragment, "primaryLanguage"> & {
|
|
17
15
|
primaryLanguage: {
|
|
18
|
-
color: string;
|
|
19
|
-
id
|
|
20
|
-
name: string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
totalPRsAuthored
|
|
25
|
-
totalPRsCommented
|
|
26
|
-
totalPRsReviewed
|
|
27
|
-
totalIssuesAuthored
|
|
28
|
-
totalIssuesCommented
|
|
16
|
+
color: string | null;
|
|
17
|
+
id?: string;
|
|
18
|
+
name: string | null;
|
|
19
|
+
} | null;
|
|
20
|
+
};
|
|
21
|
+
export interface RepoUserStats {
|
|
22
|
+
totalPRsAuthored?: number;
|
|
23
|
+
totalPRsCommented?: number;
|
|
24
|
+
totalPRsReviewed?: number;
|
|
25
|
+
totalIssuesAuthored?: number;
|
|
26
|
+
totalIssuesCommented?: number;
|
|
29
27
|
}
|
|
28
|
+
export type RepositoryData = RepoInfo & RepoUserStats;
|
|
30
29
|
export interface StatsData {
|
|
31
30
|
name: string;
|
|
32
31
|
totalPRs: number;
|
|
@@ -39,11 +38,13 @@ export interface StatsData {
|
|
|
39
38
|
totalDiscussionsStarted: number;
|
|
40
39
|
totalDiscussionsAnswered: number;
|
|
41
40
|
contributedTo: number;
|
|
41
|
+
allTimeContributedTo: number;
|
|
42
42
|
totalPRsAuthored: number;
|
|
43
43
|
totalPRsCommented: number;
|
|
44
44
|
totalPRsReviewed: number;
|
|
45
45
|
totalIssuesAuthored: number;
|
|
46
46
|
totalIssuesCommented: number;
|
|
47
|
+
totalContributions: number;
|
|
47
48
|
rank: {
|
|
48
49
|
level: string;
|
|
49
50
|
percentile: number;
|
|
@@ -51,8 +52,10 @@ export interface StatsData {
|
|
|
51
52
|
}
|
|
52
53
|
export interface Lang {
|
|
53
54
|
name: string;
|
|
54
|
-
color: string;
|
|
55
|
+
color: string | null;
|
|
55
56
|
size: number;
|
|
57
|
+
/** Number of repositories the language appears in. */
|
|
58
|
+
count: number;
|
|
56
59
|
}
|
|
57
60
|
export type TopLangData = Record<string, Lang>;
|
|
58
61
|
export interface WakaTimeData {
|
|
@@ -123,4 +126,5 @@ export interface WakaTimeLang {
|
|
|
123
126
|
text: string;
|
|
124
127
|
percent: number;
|
|
125
128
|
}
|
|
129
|
+
export {};
|
|
126
130
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/fetchers/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/fetchers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,KAAK,QAAQ,GAAG,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,GAAG;IAC1D,eAAe,EAAE;QACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;KACrB,GAAG,IAAI,CAAC;CACV,CAAC;AAEF,MAAM,WAAW,aAAa;IAE5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC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AE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC,CAAC;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,sCAAsC,EAAE,MAAM,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import type { WakaTimeData } from "./types.js";
|
|
1
2
|
/**
|
|
2
3
|
* WakaTime data fetcher.
|
|
3
4
|
*
|
|
4
|
-
* @param
|
|
5
|
-
* @
|
|
5
|
+
* @param props Fetcher props.
|
|
6
|
+
* @param props.username WakaTime username.
|
|
7
|
+
* @param props.api_domain Optional WakaTime API domain (defaults to `wakatime.com`).
|
|
8
|
+
* @returns WakaTime data response.
|
|
6
9
|
*/
|
|
7
|
-
|
|
10
|
+
declare const fetchWakatimeStats: ({ username, api_domain, }: {
|
|
8
11
|
username: string;
|
|
9
|
-
api_domain
|
|
10
|
-
})
|
|
12
|
+
api_domain?: string;
|
|
13
|
+
}) => Promise<WakaTimeData>;
|
|
14
|
+
export { fetchWakatimeStats };
|
|
11
15
|
//# sourceMappingURL=wakatime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wakatime.d.ts","sourceRoot":"","sources":["../../src/fetchers/wakatime.
|
|
1
|
+
{"version":3,"file":"wakatime.d.ts","sourceRoot":"","sources":["../../src/fetchers/wakatime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;;GAOG;AACH,QAAA,MAAM,kBAAkB,GAAU,2BAG/B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,KAAG,OAAO,CAAC,YAAY,CA0BvB,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -3,10 +3,12 @@ import { CustomError, MissingParamError } from "../common/error.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* WakaTime data fetcher.
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
7
|
-
* @
|
|
6
|
+
* @param props Fetcher props.
|
|
7
|
+
* @param props.username WakaTime username.
|
|
8
|
+
* @param props.api_domain Optional WakaTime API domain (defaults to `wakatime.com`).
|
|
9
|
+
* @returns WakaTime data response.
|
|
8
10
|
*/
|
|
9
|
-
const fetchWakatimeStats = async ({ username, api_domain }) => {
|
|
11
|
+
const fetchWakatimeStats = async ({ username, api_domain, }) => {
|
|
10
12
|
if (!username) {
|
|
11
13
|
throw new MissingParamError(["username"]);
|
|
12
14
|
}
|
|
@@ -15,7 +17,9 @@ const fetchWakatimeStats = async ({ username, api_domain }) => {
|
|
|
15
17
|
return data.data;
|
|
16
18
|
}
|
|
17
19
|
catch (err) {
|
|
18
|
-
if (
|
|
20
|
+
if (axios.isAxiosError(err) &&
|
|
21
|
+
err.response &&
|
|
22
|
+
(err.response.status < 200 || err.response.status > 299)) {
|
|
19
23
|
throw new CustomError(`Could not resolve to a User with the login of '${username}'`, "WAKATIME_USER_NOT_FOUND");
|
|
20
24
|
}
|
|
21
25
|
throw err;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { YearContributionsFragment } from "./generated/stats.js";
|
|
2
|
+
interface ContributionsQueryVariables {
|
|
3
|
+
login: string;
|
|
4
|
+
}
|
|
5
|
+
interface ContributionsQuery {
|
|
6
|
+
user: Record<`year_${number}`, YearContributionsFragment> | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Build the all-time contributions query, one aliased `contributionsCollection` field per year.
|
|
10
|
+
* The shape is only known at runtime.
|
|
11
|
+
*
|
|
12
|
+
* @param years Contribution years, one `year_<year>` alias each.
|
|
13
|
+
* @returns Document for `createGraphQLFetcher`.
|
|
14
|
+
*/
|
|
15
|
+
declare const buildContributionsDocument: (years: Array<number>) => import("./graphqlDocument.js").GraphQLDocument<ContributionsQuery, ContributionsQueryVariables>;
|
|
16
|
+
export { buildContributionsDocument };
|
|
17
|
+
export type { ContributionsQuery };
|
|
18
|
+
//# sourceMappingURL=contributionsDocument.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contributionsDocument.d.ts","sourceRoot":"","sources":["../../src/graphql/contributionsDocument.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAGtE,UAAU,2BAA2B;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,yBAAyB,CAAC,GAAG,IAAI,CAAC;CAClE;AAED;;;;;;GAMG;AACH,QAAA,MAAM,0BAA0B,GAAI,OAAO,KAAK,CAAC,MAAM,CAAC,oGAoBvD,CAAC;AAEF,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getGitHubYearRange, toGitHubDateTime } from "../common/date.js";
|
|
2
|
+
import { graphqlDocument } from "./graphqlDocument.js";
|
|
3
|
+
/**
|
|
4
|
+
* Build the all-time contributions query, one aliased `contributionsCollection` field per year.
|
|
5
|
+
* The shape is only known at runtime.
|
|
6
|
+
*
|
|
7
|
+
* @param years Contribution years, one `year_<year>` alias each.
|
|
8
|
+
* @returns Document for `createGraphQLFetcher`.
|
|
9
|
+
*/
|
|
10
|
+
const buildContributionsDocument = (years) => {
|
|
11
|
+
const yearFields = years
|
|
12
|
+
.map((year) => {
|
|
13
|
+
const { from, to } = getGitHubYearRange(year);
|
|
14
|
+
return `year_${year}: contributionsCollection(from: "${toGitHubDateTime(from)}", to: "${toGitHubDateTime(to)}") { ...YearContributions }`;
|
|
15
|
+
})
|
|
16
|
+
.join("\n");
|
|
17
|
+
// fragment must match queries/stats.graphql, which generates its type
|
|
18
|
+
return graphqlDocument(`
|
|
19
|
+
query userContributions($login: String!) {
|
|
20
|
+
user(login: $login) {
|
|
21
|
+
${yearFields}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
fragment YearContributions on ContributionsCollection {
|
|
25
|
+
contributionCalendar {
|
|
26
|
+
totalContributions
|
|
27
|
+
}
|
|
28
|
+
}`);
|
|
29
|
+
};
|
|
30
|
+
export { buildContributionsDocument };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type Maybe<T> = T | null;
|
|
2
|
+
export type InputMaybe<T> = Maybe<T>;
|
|
3
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
4
|
+
export type Scalars = {
|
|
5
|
+
ID: {
|
|
6
|
+
input: string;
|
|
7
|
+
output: string;
|
|
8
|
+
};
|
|
9
|
+
String: {
|
|
10
|
+
input: string;
|
|
11
|
+
output: string;
|
|
12
|
+
};
|
|
13
|
+
Boolean: {
|
|
14
|
+
input: boolean;
|
|
15
|
+
output: boolean;
|
|
16
|
+
};
|
|
17
|
+
Int: {
|
|
18
|
+
input: number;
|
|
19
|
+
output: number;
|
|
20
|
+
};
|
|
21
|
+
Float: {
|
|
22
|
+
input: number;
|
|
23
|
+
output: number;
|
|
24
|
+
};
|
|
25
|
+
/** An ISO-8601 encoded UTC date string. */
|
|
26
|
+
DateTime: {
|
|
27
|
+
input: string;
|
|
28
|
+
output: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/** The affiliation of a user to a repository */
|
|
32
|
+
export type RepositoryAffiliation =
|
|
33
|
+
/** Repositories that the user has been added to as a collaborator. */
|
|
34
|
+
"COLLABORATOR"
|
|
35
|
+
/**
|
|
36
|
+
* Repositories that the user has access to through being a member of an
|
|
37
|
+
* organization. This includes every repository on every team that the user is on.
|
|
38
|
+
*/
|
|
39
|
+
| "ORGANIZATION_MEMBER"
|
|
40
|
+
/** Repositories that are owned by the authenticated user. */
|
|
41
|
+
| "OWNER";
|
|
42
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/graphql/generated/common.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAChC,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;AACrC,qEAAqE;AACrE,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,OAAO,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC;IAC7C,GAAG,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,2CAA2C;IAC3C,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,qBAAqB;AAC/B,sEAAsE;AACpE,cAAc;AAChB;;;GAGG;GACD,qBAAqB;AACvB,6DAA6D;GAC3D,OAAO,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Internal type. DO NOT USE DIRECTLY. */
|
|
2
|
+
type Exact<T extends {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
}> = {
|
|
5
|
+
[K in keyof T]: T[K];
|
|
6
|
+
};
|
|
7
|
+
export type GistFileInfoFragment = {
|
|
8
|
+
name: string | null;
|
|
9
|
+
size: number | null;
|
|
10
|
+
language: {
|
|
11
|
+
name: string;
|
|
12
|
+
} | null;
|
|
13
|
+
};
|
|
14
|
+
export type GistInfoQueryVariables = Exact<{
|
|
15
|
+
gistName: string;
|
|
16
|
+
}>;
|
|
17
|
+
export type GistInfoQuery = {
|
|
18
|
+
viewer: {
|
|
19
|
+
gist: {
|
|
20
|
+
description: string | null;
|
|
21
|
+
stargazerCount: number;
|
|
22
|
+
owner: {
|
|
23
|
+
login: string;
|
|
24
|
+
} | {
|
|
25
|
+
login: string;
|
|
26
|
+
} | null;
|
|
27
|
+
forks: {
|
|
28
|
+
totalCount: number;
|
|
29
|
+
};
|
|
30
|
+
files: Array<{
|
|
31
|
+
name: string | null;
|
|
32
|
+
size: number | null;
|
|
33
|
+
language: {
|
|
34
|
+
name: string;
|
|
35
|
+
} | null;
|
|
36
|
+
} | null> | null;
|
|
37
|
+
} | null;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare const GistInfoDocument: import("../graphqlDocument.js").GraphQLDocument<GistInfoQuery, Exact<{
|
|
41
|
+
gistName: string;
|
|
42
|
+
}>>;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=gist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gist.d.ts","sourceRoot":"","sources":["../../../src/graphql/generated/gist.ts"],"names":[],"mappings":"AAEA,0CAA0C;AAC1C,KAAK,KAAK,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAE5E,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;YAC3B,cAAc,EAAE,MAAM,CAAC;YACvB,KAAK,EAAE;gBAAE,KAAK,EAAE,MAAM,CAAA;aAAE,GAAG;gBAAE,KAAK,EAAE,MAAM,CAAA;aAAE,GAAG,IAAI,CAAC;YACpD,KAAK,EAAE;gBAAE,UAAU,EAAE,MAAM,CAAA;aAAE,CAAC;YAC9B,KAAK,EAAE,KAAK,CAAC;gBACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;gBACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;gBACpB,QAAQ,EAAE;oBAAE,IAAI,EAAE,MAAM,CAAA;iBAAE,GAAG,IAAI,CAAC;aACnC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;SAClB,GAAG,IAAI,CAAC;KACV,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,gBAAgB;cAnBjB,MAAM;GA8Cf,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Generated file — see .github/CONTRIBUTING.md
|
|
2
|
+
import { graphqlDocument } from "../graphqlDocument.js";
|
|
3
|
+
export const GistInfoDocument = graphqlDocument(`
|
|
4
|
+
query gistInfo($gistName: String!) {
|
|
5
|
+
viewer {
|
|
6
|
+
gist(name: $gistName) {
|
|
7
|
+
description
|
|
8
|
+
owner {
|
|
9
|
+
login
|
|
10
|
+
}
|
|
11
|
+
stargazerCount
|
|
12
|
+
forks {
|
|
13
|
+
totalCount
|
|
14
|
+
}
|
|
15
|
+
files {
|
|
16
|
+
...GistFileInfo
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
fragment GistFileInfo on GistFile {
|
|
22
|
+
name
|
|
23
|
+
language {
|
|
24
|
+
name
|
|
25
|
+
}
|
|
26
|
+
size
|
|
27
|
+
}`);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** Internal type. DO NOT USE DIRECTLY. */
|
|
2
|
+
type Exact<T extends {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
}> = {
|
|
5
|
+
[K in keyof T]: T[K];
|
|
6
|
+
};
|
|
7
|
+
export type RepoInfoFragment = {
|
|
8
|
+
name: string;
|
|
9
|
+
nameWithOwner: string;
|
|
10
|
+
isPrivate: boolean;
|
|
11
|
+
isArchived: boolean;
|
|
12
|
+
isTemplate: boolean;
|
|
13
|
+
stargazerCount: number;
|
|
14
|
+
description: string | null;
|
|
15
|
+
forkCount: number;
|
|
16
|
+
primaryLanguage: {
|
|
17
|
+
color: string | null;
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
} | null;
|
|
21
|
+
};
|
|
22
|
+
export type GetRepoQueryVariables = Exact<{
|
|
23
|
+
login: string;
|
|
24
|
+
repo: string;
|
|
25
|
+
}>;
|
|
26
|
+
export type GetRepoQuery = {
|
|
27
|
+
user: {
|
|
28
|
+
repository: {
|
|
29
|
+
name: string;
|
|
30
|
+
nameWithOwner: string;
|
|
31
|
+
isPrivate: boolean;
|
|
32
|
+
isArchived: boolean;
|
|
33
|
+
isTemplate: boolean;
|
|
34
|
+
stargazerCount: number;
|
|
35
|
+
description: string | null;
|
|
36
|
+
forkCount: number;
|
|
37
|
+
primaryLanguage: {
|
|
38
|
+
color: string | null;
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
} | null;
|
|
42
|
+
} | null;
|
|
43
|
+
} | null;
|
|
44
|
+
organization: {
|
|
45
|
+
repository: {
|
|
46
|
+
name: string;
|
|
47
|
+
nameWithOwner: string;
|
|
48
|
+
isPrivate: boolean;
|
|
49
|
+
isArchived: boolean;
|
|
50
|
+
isTemplate: boolean;
|
|
51
|
+
stargazerCount: number;
|
|
52
|
+
description: string | null;
|
|
53
|
+
forkCount: number;
|
|
54
|
+
primaryLanguage: {
|
|
55
|
+
color: string | null;
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
} | null;
|
|
59
|
+
} | null;
|
|
60
|
+
} | null;
|
|
61
|
+
};
|
|
62
|
+
export declare const GetRepoDocument: import("../graphqlDocument.js").GraphQLDocument<GetRepoQuery, Exact<{
|
|
63
|
+
login: string;
|
|
64
|
+
repo: string;
|
|
65
|
+
}>>;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=repo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../../src/graphql/generated/repo.ts"],"names":[],"mappings":"AAEA,0CAA0C;AAC1C,KAAK,KAAK,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAE5E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM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MAAM,CAAC;aACd,GAAG,IAAI,CAAC;SACV,GAAG,IAAI,CAAC;KACV,GAAG,IAAI,CAAC;CACV,CAAC;AAEF,eAAO,MAAM,eAAe;WAzCnB,MAAM;UACP,MAAM;GAsEX,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Generated file — see .github/CONTRIBUTING.md
|
|
2
|
+
import { graphqlDocument } from "../graphqlDocument.js";
|
|
3
|
+
export const GetRepoDocument = graphqlDocument(`
|
|
4
|
+
query getRepo($login: String!, $repo: String!) {
|
|
5
|
+
user(login: $login) {
|
|
6
|
+
repository(name: $repo) {
|
|
7
|
+
...RepoInfo
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
organization(login: $login) {
|
|
11
|
+
repository(name: $repo) {
|
|
12
|
+
...RepoInfo
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
fragment RepoInfo on Repository {
|
|
17
|
+
name
|
|
18
|
+
nameWithOwner
|
|
19
|
+
isPrivate
|
|
20
|
+
isArchived
|
|
21
|
+
isTemplate
|
|
22
|
+
stargazerCount
|
|
23
|
+
description
|
|
24
|
+
primaryLanguage {
|
|
25
|
+
color
|
|
26
|
+
id
|
|
27
|
+
name
|
|
28
|
+
}
|
|
29
|
+
forkCount
|
|
30
|
+
}`);
|