@stats-forge/github-stats-forge-core 0.0.2 → 0.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/README.md +0 -10
- package/build/api/api-result.d.ts +6 -7
- package/build/api/api-result.d.ts.map +1 -1
- package/build/api/api-result.js +4 -5
- package/build/api/contributed-to.d.ts +23 -0
- package/build/api/contributed-to.d.ts.map +1 -0
- package/build/api/contributed-to.js +43 -0
- package/build/api/gist.d.ts +8 -22
- package/build/api/gist.d.ts.map +1 -1
- package/build/api/gist.js +14 -36
- package/build/api/handler.d.ts +16 -0
- package/build/api/handler.d.ts.map +1 -0
- package/build/api/handler.js +29 -0
- package/build/api/index.d.ts +13 -12
- package/build/api/index.d.ts.map +1 -1
- package/build/api/index.js +1 -0
- package/build/api/params.d.ts +21 -12
- package/build/api/params.d.ts.map +1 -1
- package/build/api/params.js +41 -19
- package/build/api/pin.d.ts +11 -31
- package/build/api/pin.d.ts.map +1 -1
- package/build/api/pin.js +35 -63
- package/build/api/stats.d.ts +15 -16
- package/build/api/stats.d.ts.map +1 -1
- package/build/api/stats.js +60 -99
- package/build/api/top-langs.d.ts +13 -18
- package/build/api/top-langs.d.ts.map +1 -1
- package/build/api/top-langs.js +35 -72
- package/build/api/wakatime.d.ts +11 -17
- package/build/api/wakatime.d.ts.map +1 -1
- package/build/api/wakatime.js +27 -64
- package/build/calculateRank.d.ts +0 -9
- package/build/calculateRank.d.ts.map +1 -1
- package/build/calculateRank.js +12 -17
- package/build/cards/contributed-to.d.ts +19 -0
- package/build/cards/contributed-to.d.ts.map +1 -0
- package/build/cards/contributed-to.js +242 -0
- package/build/cards/gist.d.ts +3 -4
- package/build/cards/gist.d.ts.map +1 -1
- package/build/cards/gist.js +38 -43
- package/build/cards/options.d.ts +1 -1
- package/build/cards/repo.d.ts +14 -5
- package/build/cards/repo.d.ts.map +1 -1
- package/build/cards/repo.js +93 -103
- package/build/cards/stats.d.ts +18 -11
- package/build/cards/stats.d.ts.map +1 -1
- package/build/cards/stats.js +191 -222
- package/build/cards/top-languages.d.ts +18 -33
- package/build/cards/top-languages.d.ts.map +1 -1
- package/build/cards/top-languages.js +196 -387
- package/build/cards/wakatime.d.ts +17 -8
- package/build/cards/wakatime.d.ts.map +1 -1
- package/build/cards/wakatime.js +133 -187
- package/build/common/Card.d.ts +20 -59
- package/build/common/Card.d.ts.map +1 -1
- package/build/common/Card.js +131 -198
- package/build/common/I18n.d.ts +1 -7
- package/build/common/I18n.d.ts.map +1 -1
- package/build/common/I18n.js +7 -8
- package/build/common/brand.d.ts +76 -0
- package/build/common/brand.d.ts.map +1 -0
- package/build/common/brand.js +73 -0
- package/build/common/color.d.ts +4 -17
- package/build/common/color.d.ts.map +1 -1
- package/build/common/color.js +67 -49
- package/build/common/config.d.ts +4 -14
- package/build/common/config.d.ts.map +1 -1
- package/build/common/config.js +3 -16
- package/build/common/constants.d.ts +6 -2
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +5 -1
- package/build/common/date.d.ts +50 -5
- package/build/common/date.d.ts.map +1 -1
- package/build/common/date.js +104 -4
- package/build/common/emojiMap.d.ts +8 -0
- package/build/common/emojiMap.d.ts.map +1 -0
- package/build/common/emojiMap.js +10 -0
- package/build/common/emojiMap.json +1915 -0
- package/build/common/error.d.ts +1 -10
- package/build/common/error.d.ts.map +1 -1
- package/build/common/error.js +1 -10
- package/build/common/fmt.d.ts +3 -15
- package/build/common/fmt.d.ts.map +1 -1
- package/build/common/fmt.js +7 -35
- package/build/common/http.d.ts +2 -7
- package/build/common/http.d.ts.map +1 -1
- package/build/common/http.js +8 -17
- package/build/common/icons.d.ts +20 -20
- package/build/common/icons.d.ts.map +1 -1
- package/build/common/icons.js +108 -67
- package/build/common/languageColors.d.ts +0 -1
- package/build/common/languageColors.d.ts.map +1 -1
- package/build/common/languageColors.js +1 -4
- package/build/common/languageColors.json +18 -2
- package/build/common/ops.d.ts +11 -17
- package/build/common/ops.d.ts.map +1 -1
- package/build/common/ops.js +22 -39
- package/build/common/render.d.ts +34 -82
- package/build/common/render.d.ts.map +1 -1
- package/build/common/render.js +225 -259
- package/build/common/retryer.d.ts +2 -7
- package/build/common/retryer.d.ts.map +1 -1
- package/build/common/retryer.js +4 -11
- package/build/fetchers/contributed-to.d.ts +62 -0
- package/build/fetchers/contributed-to.d.ts.map +1 -0
- package/build/fetchers/contributed-to.js +184 -0
- package/build/fetchers/gist.d.ts +2 -5
- package/build/fetchers/gist.d.ts.map +1 -1
- package/build/fetchers/gist.js +1 -5
- package/build/fetchers/graphql-error.d.ts +13 -0
- package/build/fetchers/graphql-error.d.ts.map +1 -0
- package/build/fetchers/graphql-error.js +29 -0
- package/build/fetchers/index.d.ts +13 -12
- package/build/fetchers/index.d.ts.map +1 -1
- package/build/fetchers/index.js +1 -0
- package/build/fetchers/repo.d.ts +2 -11
- package/build/fetchers/repo.d.ts.map +1 -1
- package/build/fetchers/repo.js +20 -33
- package/build/fetchers/stats.d.ts +16 -40
- package/build/fetchers/stats.d.ts.map +1 -1
- package/build/fetchers/stats.js +89 -271
- package/build/fetchers/top-languages.d.ts +2 -9
- package/build/fetchers/top-languages.d.ts.map +1 -1
- package/build/fetchers/top-languages.js +16 -47
- package/build/fetchers/types.d.ts +25 -1
- package/build/fetchers/types.d.ts.map +1 -1
- package/build/fetchers/wakatime.d.ts +2 -6
- package/build/fetchers/wakatime.d.ts.map +1 -1
- package/build/fetchers/wakatime.js +1 -5
- package/build/graphql/contributionsCollection.d.ts +9 -0
- package/build/graphql/contributionsCollection.d.ts.map +1 -0
- package/build/graphql/contributionsCollection.js +12 -0
- package/build/graphql/contributionsDocument.d.ts +6 -6
- package/build/graphql/contributionsDocument.d.ts.map +1 -1
- package/build/graphql/contributionsDocument.js +8 -16
- package/build/graphql/generated/contributed-to.d.ts +22 -0
- package/build/graphql/generated/contributed-to.d.ts.map +1 -0
- package/build/graphql/generated/contributed-to.js +11 -0
- package/build/graphql/generated/gist.d.ts +1 -1
- package/build/graphql/generated/repo.d.ts +1 -1
- package/build/graphql/generated/stats.d.ts +16 -4
- package/build/graphql/generated/stats.d.ts.map +1 -1
- package/build/graphql/generated/stats.js +2 -2
- package/build/graphql/generated/top-languages.d.ts +2 -2
- package/build/graphql/graphqlDocument.d.ts +1 -2
- package/build/graphql/graphqlDocument.d.ts.map +1 -1
- package/build/graphql/graphqlDocument.js +0 -1
- package/build/graphql/reposContributedToDocument.d.ts +4 -5
- package/build/graphql/reposContributedToDocument.d.ts.map +1 -1
- package/build/graphql/reposContributedToDocument.js +11 -7
- package/build/markup/css.d.ts +35 -0
- package/build/markup/css.d.ts.map +1 -0
- package/build/markup/css.js +64 -0
- package/build/markup/element.d.ts +41 -0
- package/build/markup/element.d.ts.map +1 -0
- package/build/markup/element.js +127 -0
- package/build/markup/html.d.ts +13 -0
- package/build/markup/html.d.ts.map +1 -0
- package/build/markup/html.js +27 -0
- package/build/markup/index.d.ts +9 -0
- package/build/markup/index.d.ts.map +1 -0
- package/build/markup/index.js +6 -0
- package/build/markup/serialize.d.ts +16 -0
- package/build/markup/serialize.d.ts.map +1 -0
- package/build/markup/serialize.js +17 -0
- package/build/themes/index.d.ts +332 -333
- package/build/themes/index.d.ts.map +1 -1
- package/build/themes/index.js +1 -1
- package/build/translations.d.ts +66 -7
- package/build/translations.d.ts.map +1 -1
- package/build/translations.js +686 -629
- package/package.json +17 -26
- package/src/api/api-result.ts +10 -9
- package/src/api/contributed-to.ts +84 -0
- package/src/api/gist.ts +22 -46
- package/src/api/handler.ts +42 -0
- package/src/api/index.ts +13 -12
- package/src/api/params.ts +74 -29
- package/src/api/pin.ts +38 -65
- package/src/api/stats.ts +81 -118
- package/src/api/top-langs.ts +38 -80
- package/src/api/wakatime.ts +35 -73
- package/src/calculateRank.ts +12 -23
- package/src/cards/contributed-to.ts +373 -0
- package/src/cards/gist.ts +55 -49
- package/src/cards/options.ts +1 -1
- package/src/cards/repo.ts +134 -120
- package/src/cards/stats.ts +262 -252
- package/src/cards/top-languages.ts +315 -422
- package/src/cards/wakatime.ts +207 -225
- package/src/common/Card.ts +207 -214
- package/src/common/I18n.ts +7 -8
- package/src/common/brand.ts +109 -0
- package/src/common/color.ts +80 -57
- package/src/common/config.ts +5 -18
- package/src/common/constants.ts +8 -2
- package/src/common/date.ts +135 -5
- package/src/common/emojiMap.json +1915 -0
- package/src/common/emojiMap.ts +13 -0
- package/src/common/error.ts +2 -11
- package/src/common/fmt.ts +7 -44
- package/src/common/http.ts +9 -15
- package/src/common/icons.ts +122 -42
- package/src/common/languageColors.json +18 -2
- package/src/common/languageColors.ts +1 -4
- package/src/common/ops.ts +31 -48
- package/src/common/render.ts +334 -284
- package/src/common/retryer.ts +8 -15
- package/src/fetchers/contributed-to.ts +271 -0
- package/src/fetchers/gist.ts +8 -12
- package/src/fetchers/graphql-error.ts +36 -0
- package/src/fetchers/index.ts +15 -12
- package/src/fetchers/repo.ts +27 -40
- package/src/fetchers/stats.ts +157 -366
- package/src/fetchers/top-languages.ts +27 -55
- package/src/fetchers/types.ts +27 -1
- package/src/fetchers/wakatime.ts +5 -9
- package/src/graphql/contributionsCollection.ts +18 -0
- package/src/graphql/contributionsDocument.ts +14 -19
- package/src/graphql/generated/contributed-to.ts +25 -0
- package/src/graphql/generated/gist.ts +1 -1
- package/src/graphql/generated/repo.ts +1 -1
- package/src/graphql/generated/stats.ts +21 -8
- package/src/graphql/generated/top-languages.ts +2 -2
- package/src/graphql/graphqlDocument.ts +1 -2
- package/src/graphql/queries/contributed-to.graphql +8 -0
- package/src/graphql/queries/stats.graphql +14 -2
- package/src/graphql/reposContributedToDocument.ts +16 -15
- package/src/markup/css.ts +118 -0
- package/src/markup/element.ts +246 -0
- package/src/markup/html.ts +34 -0
- package/src/markup/index.ts +9 -0
- package/src/markup/serialize.ts +27 -0
- package/src/themes/index.ts +1 -1
- package/src/translations.ts +699 -629
- package/build/cards/index.d.ts +0 -11
- package/build/cards/index.d.ts.map +0 -1
- package/build/cards/index.js +0 -7
- package/build/common/html.d.ts +0 -8
- package/build/common/html.d.ts.map +0 -1
- package/build/common/html.js +0 -14
- package/build/index.d.ts +0 -15
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -10
- package/src/_emoji-name-map.d.ts +0 -10
- package/src/_github-username-regex.d.ts +0 -4
- package/src/cards/index.ts +0 -21
- package/src/common/html.ts +0 -17
- package/src/index.ts +0 -18
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import { CardError
|
|
2
|
-
import { wrapTextMultiline } from '../common/fmt.js';
|
|
1
|
+
import { CardError } from '../common/error.js';
|
|
3
2
|
import { createGraphQLFetcher } from '../common/http.js';
|
|
4
|
-
import { logger } from '../common/log.js';
|
|
5
3
|
import { parseOwnerAffiliations } from '../common/ops.js';
|
|
6
4
|
import { retryer } from '../common/retryer.js';
|
|
7
5
|
import { TopLanguagesDocument } from '../graphql/generated/top-languages.js';
|
|
6
|
+
import { graphqlError } from './graphql-error.js';
|
|
8
7
|
const fetcher = createGraphQLFetcher(TopLanguagesDocument, 'token');
|
|
9
8
|
/**
|
|
10
9
|
* Fetch top languages for a given username.
|
|
11
10
|
*
|
|
12
|
-
* @param props Fetcher props.
|
|
13
|
-
* @param props.username GitHub username.
|
|
14
|
-
* @param props.exclude_repo List of repositories to exclude. Default: [].
|
|
15
|
-
* @param props.size_weight Weightage to be given to size.
|
|
16
|
-
* @param props.count_weight Weightage to be given to count.
|
|
17
|
-
* @param props.ownerAffiliations The owner affiliations to filter by. Default: OWNER.
|
|
18
|
-
* @param config Deployment config supplying the PAT pool.
|
|
19
11
|
* @returns Top languages data.
|
|
20
12
|
*/
|
|
21
13
|
const fetchTopLanguages = async ({ username, exclude_repo = [], size_weight = 1, count_weight = 0, ownerAffiliations = [], }, config) => {
|
|
@@ -28,62 +20,39 @@ const fetchTopLanguages = async ({ username, exclude_repo = [], size_weight = 1,
|
|
|
28
20
|
ownerAffiliations: affiliations,
|
|
29
21
|
}, config);
|
|
30
22
|
if (res.data.errors) {
|
|
31
|
-
|
|
32
|
-
const firstError = res.data.errors[0];
|
|
33
|
-
if (firstError?.type === 'NOT_FOUND') {
|
|
34
|
-
throw new CardError(firstError.message || 'Could not fetch user.', {
|
|
35
|
-
code: 'not_found',
|
|
36
|
-
secondaryMessage: USER_NOT_FOUND,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
if (firstError?.message) {
|
|
40
|
-
throw new CardError(wrapTextMultiline(firstError.message, 525, 12)[0] ?? '', {
|
|
41
|
-
code: 'upstream',
|
|
42
|
-
secondaryMessage: res.statusText,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
throw new CardError('Something went wrong while trying to retrieve the language data using the GraphQL API.', { code: 'upstream' });
|
|
23
|
+
throw graphqlError(res.data.errors, res.statusText, 'Something went wrong while trying to retrieve the language data using the GraphQL API.');
|
|
46
24
|
}
|
|
47
25
|
const repoToHide = {};
|
|
48
26
|
const allExcludedRepos = [...exclude_repo, ...config.excludeRepositories];
|
|
49
27
|
// populate repoToHide map for quick lookup while filtering out
|
|
50
|
-
|
|
28
|
+
for (const repoName of allExcludedRepos) {
|
|
51
29
|
repoToHide[repoName] = true;
|
|
52
|
-
}
|
|
30
|
+
}
|
|
53
31
|
// filter out repositories to be hidden
|
|
54
32
|
const repoNodes = (res.data.data.user?.repositories.nodes ?? []).filter((node) => !!node && !repoToHide[node.name]);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const languageEdges = repoNodes.reduce((acc, repo) => {
|
|
33
|
+
let languageEdges = [];
|
|
34
|
+
for (const repo of repoNodes) {
|
|
58
35
|
const edges = (repo.languages?.edges ?? []).filter((edge) => !!edge);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
36
|
+
if (edges.length > 0) {
|
|
37
|
+
languageEdges = [...edges, ...languageEdges];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// accumulate size and repo count per language, each read back off the language's own entry
|
|
62
41
|
const languageMap = {};
|
|
63
|
-
let repoCount = 0;
|
|
64
42
|
for (const edge of languageEdges) {
|
|
65
43
|
const existing = languageMap[edge.node.name];
|
|
66
|
-
// same language seen again: add to its size and bump count; else reset to 1
|
|
67
|
-
let langSize = edge.size;
|
|
68
|
-
if (existing && edge.node.name === existing.name) {
|
|
69
|
-
langSize = edge.size + existing.size;
|
|
70
|
-
repoCount += 1;
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
repoCount = 1;
|
|
74
|
-
}
|
|
75
44
|
languageMap[edge.node.name] = {
|
|
76
45
|
name: edge.node.name,
|
|
77
46
|
color: edge.node.color,
|
|
78
|
-
size:
|
|
79
|
-
count:
|
|
47
|
+
size: edge.size + (existing?.size ?? 0),
|
|
48
|
+
count: (existing?.count ?? 0) + 1,
|
|
80
49
|
};
|
|
81
50
|
}
|
|
82
51
|
// comparison index calculation
|
|
83
52
|
for (const lang of Object.values(languageMap)) {
|
|
84
|
-
lang.size =
|
|
53
|
+
lang.size = lang.size ** size_weight * lang.count ** count_weight;
|
|
85
54
|
}
|
|
86
55
|
// return languages sorted by (weighted) size, descending
|
|
87
|
-
return Object.fromEntries(Object.entries(languageMap).
|
|
56
|
+
return Object.fromEntries(Object.entries(languageMap).toSorted(([, a], [, b]) => b.size - a.size));
|
|
88
57
|
};
|
|
89
58
|
export { fetchTopLanguages };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GitHubDateRange } from '../common/date.ts';
|
|
2
|
+
import type { RepoInfoFragment } from '../graphql/generated/repo.ts';
|
|
2
3
|
export interface GistData {
|
|
3
4
|
name: string;
|
|
4
5
|
nameWithOwner: string;
|
|
@@ -33,6 +34,8 @@ export interface StatsData {
|
|
|
33
34
|
mergedPRsPercentage: number;
|
|
34
35
|
totalReviews: number;
|
|
35
36
|
totalCommits: number;
|
|
37
|
+
/** The range `totalCommits` covers; `undefined` when it is GitHub's own last year, or all time. */
|
|
38
|
+
commitsRange: GitHubDateRange | undefined;
|
|
36
39
|
totalIssues: number;
|
|
37
40
|
totalStars: number;
|
|
38
41
|
totalDiscussionsStarted: number;
|
|
@@ -50,6 +53,27 @@ export interface StatsData {
|
|
|
50
53
|
percentile: number;
|
|
51
54
|
};
|
|
52
55
|
}
|
|
56
|
+
/** One repository a user contributed to, as the card ranks it. */
|
|
57
|
+
export interface ContributedRepo {
|
|
58
|
+
nameWithOwner: string;
|
|
59
|
+
/**
|
|
60
|
+
* Commit-days plus issues and pull requests opened, summed over every year.
|
|
61
|
+
* Not a commit count: GitHub groups commit contributions by day, not by commit.
|
|
62
|
+
*/
|
|
63
|
+
contributions: number;
|
|
64
|
+
/** Every year the user contributed to it, ascending. */
|
|
65
|
+
years: Array<number>;
|
|
66
|
+
}
|
|
67
|
+
export interface ContributedToData {
|
|
68
|
+
/** GitHub's own casing of the login, which the query param need not match. */
|
|
69
|
+
login: string;
|
|
70
|
+
/** The ranked slice, most contributions first. */
|
|
71
|
+
repos: Array<ContributedRepo>;
|
|
72
|
+
/** Every repository the walk found, which `repos` is a slice of. */
|
|
73
|
+
totalRepos: number;
|
|
74
|
+
/** The account's contribution years, ascending — the range the year marks cover. */
|
|
75
|
+
years: Array<number>;
|
|
76
|
+
}
|
|
53
77
|
export interface Lang {
|
|
54
78
|
name: string;
|
|
55
79
|
color: string | null;
|
|
@@ -1 +1 @@
|
|
|
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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AK,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,14 +1,10 @@
|
|
|
1
|
-
import type { CardConfig } from '../common/config.
|
|
2
|
-
import type { WakaTimeData } from './types.
|
|
1
|
+
import type { CardConfig } from '../common/config.ts';
|
|
2
|
+
import type { WakaTimeData } from './types.ts';
|
|
3
3
|
/**
|
|
4
4
|
* WakaTime data fetcher.
|
|
5
5
|
*
|
|
6
6
|
* WakaTime needs no GitHub token; the config is here for the transport it carries.
|
|
7
7
|
*
|
|
8
|
-
* @param props Fetcher props.
|
|
9
|
-
* @param props.username WakaTime username.
|
|
10
|
-
* @param props.api_domain Optional WakaTime API domain (defaults to `wakatime.com`).
|
|
11
|
-
* @param config Deployment config supplying the transport.
|
|
12
8
|
* @returns WakaTime data response.
|
|
13
9
|
*/
|
|
14
10
|
declare const fetchWakatimeStats: ({ username, api_domain, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wakatime.d.ts","sourceRoot":"","sources":["../../src/fetchers/wakatime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAItD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"wakatime.d.ts","sourceRoot":"","sources":["../../src/fetchers/wakatime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAItD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;GAMG;AACH,QAAA,MAAM,kBAAkB,8BAInB;IACD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC,UACO,UAAU,KACjB,OAAO,CAAC,YAAY,CA2BtB,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -5,17 +5,13 @@ import { httpRequest } from '../common/http.js';
|
|
|
5
5
|
*
|
|
6
6
|
* WakaTime needs no GitHub token; the config is here for the transport it carries.
|
|
7
7
|
*
|
|
8
|
-
* @param props Fetcher props.
|
|
9
|
-
* @param props.username WakaTime username.
|
|
10
|
-
* @param props.api_domain Optional WakaTime API domain (defaults to `wakatime.com`).
|
|
11
|
-
* @param config Deployment config supplying the transport.
|
|
12
8
|
* @returns WakaTime data response.
|
|
13
9
|
*/
|
|
14
10
|
const fetchWakatimeStats = async ({ username, api_domain, }, config) => {
|
|
15
11
|
if (!username) {
|
|
16
12
|
throw CardError.missingParam(['username']);
|
|
17
13
|
}
|
|
18
|
-
const domain = api_domain ? api_domain.
|
|
14
|
+
const domain = api_domain ? api_domain.replaceAll(/\/$/gi, '') : 'wakatime.com';
|
|
19
15
|
const res = await httpRequest(config.fetch, `https://${domain}/api/v1/users/${username}/stats?is_including_today=true`);
|
|
20
16
|
// Only a 404 says the profile does not exist.
|
|
21
17
|
// Any other failure is WakaTime being unavailable, which a retry can still answer,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GitHubDateRange } from '../common/date.ts';
|
|
2
|
+
/**
|
|
3
|
+
* One `contributionsCollection` field per range, aliased by position.
|
|
4
|
+
*
|
|
5
|
+
* @returns The fields, for a query that selects `fragment`.
|
|
6
|
+
*/
|
|
7
|
+
declare const aliasedRanges: (ranges: Array<GitHubDateRange>, fragment: string) => string;
|
|
8
|
+
export { aliasedRanges };
|
|
9
|
+
//# sourceMappingURL=contributionsCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contributionsCollection.d.ts","sourceRoot":"","sources":["../../src/graphql/contributionsCollection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOzD;;;;GAIG;AACH,QAAA,MAAM,aAAa,WAAY,KAAK,CAAC,eAAe,CAAC,YAAY,MAAM,KAAG,MAG3D,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { toGitHubDateTime } from '../common/date.js';
|
|
2
|
+
/** Naming `to` is not optional: GitHub defaults an omitted one to a year after `from`. */
|
|
3
|
+
const contributionsCollectionOf = ({ from, to }) => `contributionsCollection(from: "${toGitHubDateTime(from)}", to: "${toGitHubDateTime(to)}")`;
|
|
4
|
+
/**
|
|
5
|
+
* One `contributionsCollection` field per range, aliased by position.
|
|
6
|
+
*
|
|
7
|
+
* @returns The fields, for a query that selects `fragment`.
|
|
8
|
+
*/
|
|
9
|
+
const aliasedRanges = (ranges, fragment) => ranges
|
|
10
|
+
.map((range, index) => `range_${index}: ${contributionsCollectionOf(range)} { ...${fragment} }`)
|
|
11
|
+
.join('\n');
|
|
12
|
+
export { aliasedRanges };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GitHubDateRange } from '../common/date.ts';
|
|
2
|
+
import type { RangeContributionsFragment } from './generated/stats.ts';
|
|
3
|
+
import type { GraphQLDocument } from './graphqlDocument.ts';
|
|
2
4
|
interface ContributionsQueryVariables {
|
|
3
5
|
login: string;
|
|
4
6
|
}
|
|
5
7
|
interface ContributionsQuery {
|
|
6
|
-
user: Record<`
|
|
8
|
+
user: Record<`range_${number}`, RangeContributionsFragment> | null;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
|
-
* Build the
|
|
10
|
-
* The shape is only known at runtime.
|
|
11
|
+
* Build the contributions query for a set of ranges. The shape is only known at runtime.
|
|
11
12
|
*
|
|
12
|
-
* @param years Contribution years, one `year_<year>` alias each.
|
|
13
13
|
* @returns Document for `createGraphQLFetcher`.
|
|
14
14
|
*/
|
|
15
|
-
declare const buildContributionsDocument: (
|
|
15
|
+
declare const buildContributionsDocument: (ranges: Array<GitHubDateRange>) => GraphQLDocument<ContributionsQuery, ContributionsQueryVariables>;
|
|
16
16
|
export { buildContributionsDocument };
|
|
17
17
|
export type { ContributionsQuery };
|
|
18
18
|
//# sourceMappingURL=contributionsDocument.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contributionsDocument.d.ts","sourceRoot":"","sources":["../../src/graphql/contributionsDocument.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contributionsDocument.d.ts","sourceRoot":"","sources":["../../src/graphql/contributionsDocument.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,UAAU,2BAA2B;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,0BAA0B,CAAC,GAAG,IAAI,CAAC;CACpE;AAED;;;;GAIG;AACH,QAAA,MAAM,0BAA0B,WACtB,KAAK,CAAC,eAAe,CAAC,KAC7B,eAAe,CAAC,kBAAkB,EAAE,2BAA2B,CAa/D,CAAC;AAEJ,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aliasedRanges } from './contributionsCollection.js';
|
|
2
2
|
import { graphqlDocument } from './graphqlDocument.js';
|
|
3
3
|
/**
|
|
4
|
-
* Build the
|
|
5
|
-
* The shape is only known at runtime.
|
|
4
|
+
* Build the contributions query for a set of ranges. The shape is only known at runtime.
|
|
6
5
|
*
|
|
7
|
-
* @param years Contribution years, one `year_<year>` alias each.
|
|
8
6
|
* @returns Document for `createGraphQLFetcher`.
|
|
9
7
|
*/
|
|
10
|
-
const buildContributionsDocument = (
|
|
11
|
-
|
|
12
|
-
|
|
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(`
|
|
8
|
+
const buildContributionsDocument = (ranges) =>
|
|
9
|
+
// fragment must match queries/stats.graphql, which generates its type
|
|
10
|
+
graphqlDocument(`
|
|
19
11
|
query userContributions($login: String!) {
|
|
20
12
|
user(login: $login) {
|
|
21
|
-
${
|
|
13
|
+
${aliasedRanges(ranges, 'RangeContributions')}
|
|
22
14
|
}
|
|
23
15
|
}
|
|
24
|
-
fragment
|
|
16
|
+
fragment RangeContributions on ContributionsCollection {
|
|
17
|
+
totalCommitContributions
|
|
25
18
|
contributionCalendar {
|
|
26
19
|
totalContributions
|
|
27
20
|
}
|
|
28
21
|
}`);
|
|
29
|
-
};
|
|
30
22
|
export { buildContributionsDocument };
|
|
@@ -0,0 +1,22 @@
|
|
|
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 UserContributionYearsQueryVariables = Exact<{
|
|
8
|
+
login: string;
|
|
9
|
+
}>;
|
|
10
|
+
export type UserContributionYearsQuery = {
|
|
11
|
+
user: {
|
|
12
|
+
login: string;
|
|
13
|
+
contributionsCollection: {
|
|
14
|
+
contributionYears: Array<number>;
|
|
15
|
+
};
|
|
16
|
+
} | null;
|
|
17
|
+
};
|
|
18
|
+
export declare const UserContributionYearsDocument: import("../graphqlDocument.ts").GraphQLDocument<UserContributionYearsQuery, Exact<{
|
|
19
|
+
login: string;
|
|
20
|
+
}>>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=contributed-to.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contributed-to.d.ts","sourceRoot":"","sources":["../../../src/graphql/generated/contributed-to.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,mCAAmC,GAAG,KAAK,CAAC;IACtD,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,uBAAuB,EAAE;YAAE,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;SAAE,CAAA;KAAE,GAAG,IAAI,CAAC;CAC/F,CAAC;AAEF,eAAO,MAAM,6BAA6B;WAPjC,MAAM;GAkBZ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Generated file — see .github/CONTRIBUTING.md
|
|
2
|
+
import { graphqlDocument } from '../graphqlDocument.js';
|
|
3
|
+
export const UserContributionYearsDocument = graphqlDocument(`
|
|
4
|
+
query userContributionYears($login: String!) {
|
|
5
|
+
user(login: $login) {
|
|
6
|
+
login
|
|
7
|
+
contributionsCollection {
|
|
8
|
+
contributionYears
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}`);
|
|
@@ -37,7 +37,7 @@ export type GistInfoQuery = {
|
|
|
37
37
|
} | null;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
export declare const GistInfoDocument: import("../graphqlDocument.
|
|
40
|
+
export declare const GistInfoDocument: import("../graphqlDocument.ts").GraphQLDocument<GistInfoQuery, Exact<{
|
|
41
41
|
gistName: string;
|
|
42
42
|
}>>;
|
|
43
43
|
export {};
|
|
@@ -59,7 +59,7 @@ export type GetRepoQuery = {
|
|
|
59
59
|
} | null;
|
|
60
60
|
} | null;
|
|
61
61
|
};
|
|
62
|
-
export declare const GetRepoDocument: import("../graphqlDocument.
|
|
62
|
+
export declare const GetRepoDocument: import("../graphqlDocument.ts").GraphQLDocument<GetRepoQuery, Exact<{
|
|
63
63
|
login: string;
|
|
64
64
|
repo: string;
|
|
65
65
|
}>>;
|
|
@@ -4,7 +4,7 @@ type Exact<T extends {
|
|
|
4
4
|
}> = {
|
|
5
5
|
[K in keyof T]: T[K];
|
|
6
6
|
};
|
|
7
|
-
import type * as Types from './common.
|
|
7
|
+
import type * as Types from './common.ts';
|
|
8
8
|
export type RepoNodeFragment = {
|
|
9
9
|
name: string;
|
|
10
10
|
stargazerCount: number;
|
|
@@ -49,6 +49,7 @@ export type UserInfoQueryVariables = Exact<{
|
|
|
49
49
|
includeDiscussions: boolean;
|
|
50
50
|
includeDiscussionsAnswers: boolean;
|
|
51
51
|
startTime?: string | null | undefined;
|
|
52
|
+
endTime?: string | null | undefined;
|
|
52
53
|
ownerAffiliations?: Array<Types.RepositoryAffiliation | null | undefined> | Types.RepositoryAffiliation | null | undefined;
|
|
53
54
|
includeUserRepositories: boolean;
|
|
54
55
|
}>;
|
|
@@ -102,7 +103,8 @@ export type UserInfoQuery = {
|
|
|
102
103
|
};
|
|
103
104
|
} | null;
|
|
104
105
|
};
|
|
105
|
-
export type
|
|
106
|
+
export type RangeContributionsFragment = {
|
|
107
|
+
totalCommitContributions: number;
|
|
106
108
|
contributionCalendar: {
|
|
107
109
|
totalContributions: number;
|
|
108
110
|
};
|
|
@@ -112,16 +114,25 @@ export type RangeContributionsByRepoFragment = {
|
|
|
112
114
|
repository: {
|
|
113
115
|
nameWithOwner: string;
|
|
114
116
|
};
|
|
117
|
+
contributions: {
|
|
118
|
+
totalCount: number;
|
|
119
|
+
};
|
|
115
120
|
}>;
|
|
116
121
|
issueContributionsByRepository: Array<{
|
|
117
122
|
repository: {
|
|
118
123
|
nameWithOwner: string;
|
|
119
124
|
};
|
|
125
|
+
contributions: {
|
|
126
|
+
totalCount: number;
|
|
127
|
+
};
|
|
120
128
|
}>;
|
|
121
129
|
pullRequestContributionsByRepository: Array<{
|
|
122
130
|
repository: {
|
|
123
131
|
nameWithOwner: string;
|
|
124
132
|
};
|
|
133
|
+
contributions: {
|
|
134
|
+
totalCount: number;
|
|
135
|
+
};
|
|
125
136
|
}>;
|
|
126
137
|
repositoryContributions?: {
|
|
127
138
|
nodes: Array<{
|
|
@@ -131,18 +142,19 @@ export type RangeContributionsByRepoFragment = {
|
|
|
131
142
|
} | null> | null;
|
|
132
143
|
};
|
|
133
144
|
};
|
|
134
|
-
export declare const UserReposDocument: import("../graphqlDocument.
|
|
145
|
+
export declare const UserReposDocument: import("../graphqlDocument.ts").GraphQLDocument<UserReposQuery, Exact<{
|
|
135
146
|
login: string;
|
|
136
147
|
after?: string | null | undefined;
|
|
137
148
|
ownerAffiliations?: Array<Types.RepositoryAffiliation | null | undefined> | Types.RepositoryAffiliation | null | undefined;
|
|
138
149
|
}>>;
|
|
139
|
-
export declare const UserInfoDocument: import("../graphqlDocument.
|
|
150
|
+
export declare const UserInfoDocument: import("../graphqlDocument.ts").GraphQLDocument<UserInfoQuery, Exact<{
|
|
140
151
|
login: string;
|
|
141
152
|
after?: string | null | undefined;
|
|
142
153
|
includeMergedPullRequests: boolean;
|
|
143
154
|
includeDiscussions: boolean;
|
|
144
155
|
includeDiscussionsAnswers: boolean;
|
|
145
156
|
startTime?: string | null | undefined;
|
|
157
|
+
endTime?: string | null | undefined;
|
|
146
158
|
ownerAffiliations?: Array<Types.RepositoryAffiliation | null | undefined> | Types.RepositoryAffiliation | null | undefined;
|
|
147
159
|
includeUserRepositories: boolean;
|
|
148
160
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/graphql/generated/stats.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;AAG5E,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE;QACZ,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,cAAc,EAAE,MAAM,CAAA;SAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;QACrE,QAAQ,EAAE;YAAE,WAAW,EAAE,OAAO,CAAC;YAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;KAC9D,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,iBAAiB,CAAC,EACd,KAAK,CAAC,KAAK,CAAC,qBAAqB,GAAG,IAAI,GAAG,SAAS,CAAC,GACrD,KAAK,CAAC,qBAAqB,GAC3B,IAAI,GACJ,SAAS,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;WAjFrB,MAAM;YACL,MAAM,GAAG,IAAI,GAAG,SAAS;wBAE7B,KAAK,CAAC,KAAK,CAAC,qBAAqB,GAAG,IAAI,GAAG,SAAS,CAAC,GACrD,KAAK,CAAC,qBAAqB,GAC3B,IAAI,GACJ,SAAS;GAqGZ,CAAC;AAEJ,eAAO,MAAM,gBAAgB;WAzFpB,MAAM;YACL,MAAM,GAAG,IAAI,GAAG,SAAS;+BACN,OAAO;wBACd,OAAO;+BACA,OAAO;gBACtB,MAAM,GAAG,IAAI,GAAG,SAAS;cAC3B,MAAM,GAAG,IAAI,GAAG,SAAS;wBAE/B,KAAK,CAAC,KAAK,CAAC,qBAAqB,GAAG,IAAI,GAAG,SAAS,CAAC,GACrD,KAAK,CAAC,qBAAqB,GAC3B,IAAI,GACJ,SAAS;6BACY,OAAO;GA8I/B,CAAC"}
|
|
@@ -28,11 +28,11 @@ fragment RepoNode on Repository {
|
|
|
28
28
|
stargazerCount
|
|
29
29
|
}`);
|
|
30
30
|
export const UserInfoDocument = graphqlDocument(`
|
|
31
|
-
query userInfo($login: String!, $after: String, $includeMergedPullRequests: Boolean!, $includeDiscussions: Boolean!, $includeDiscussionsAnswers: Boolean!, $startTime: DateTime = null, $ownerAffiliations: [RepositoryAffiliation], $includeUserRepositories: Boolean!) {
|
|
31
|
+
query userInfo($login: String!, $after: String, $includeMergedPullRequests: Boolean!, $includeDiscussions: Boolean!, $includeDiscussionsAnswers: Boolean!, $startTime: DateTime = null, $endTime: DateTime = null, $ownerAffiliations: [RepositoryAffiliation], $includeUserRepositories: Boolean!) {
|
|
32
32
|
user(login: $login) {
|
|
33
33
|
name
|
|
34
34
|
login
|
|
35
|
-
commits: contributionsCollection(from: $startTime) {
|
|
35
|
+
commits: contributionsCollection(from: $startTime, to: $endTime) {
|
|
36
36
|
totalCommitContributions
|
|
37
37
|
}
|
|
38
38
|
reviews: contributionsCollection {
|
|
@@ -4,7 +4,7 @@ type Exact<T extends {
|
|
|
4
4
|
}> = {
|
|
5
5
|
[K in keyof T]: T[K];
|
|
6
6
|
};
|
|
7
|
-
import type * as Types from './common.
|
|
7
|
+
import type * as Types from './common.ts';
|
|
8
8
|
export type TopLanguageFragment = {
|
|
9
9
|
size: number;
|
|
10
10
|
node: {
|
|
@@ -46,7 +46,7 @@ export type TopLanguagesQuery = {
|
|
|
46
46
|
};
|
|
47
47
|
} | null;
|
|
48
48
|
};
|
|
49
|
-
export declare const TopLanguagesDocument: import("../graphqlDocument.
|
|
49
|
+
export declare const TopLanguagesDocument: import("../graphqlDocument.ts").GraphQLDocument<TopLanguagesQuery, Exact<{
|
|
50
50
|
login: string;
|
|
51
51
|
ownerAffiliations?: Array<Types.RepositoryAffiliation | null | undefined> | Types.RepositoryAffiliation | null | undefined;
|
|
52
52
|
}>>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `text` is what goes over the wire; the other two members only carry types and are never assigned.
|
|
5
5
|
* Documents are generated from `queries/*.graphql`
|
|
6
|
-
* See `scripts/generate-graphql-types.
|
|
6
|
+
* See `scripts/generate-graphql-types.ts`.
|
|
7
7
|
*/
|
|
8
8
|
interface GraphQLDocument<TResult, TVariables> {
|
|
9
9
|
readonly text: string;
|
|
@@ -13,7 +13,6 @@ interface GraphQLDocument<TResult, TVariables> {
|
|
|
13
13
|
/**
|
|
14
14
|
* Build a typed document.
|
|
15
15
|
*
|
|
16
|
-
* @param text The query text, including every fragment it spreads.
|
|
17
16
|
* @returns The document to pass to the function created by `createGraphQLFetcher`.
|
|
18
17
|
*/
|
|
19
18
|
declare const graphqlDocument: <TResult, TVariables>(text: string) => GraphQLDocument<TResult, TVariables>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphqlDocument.d.ts","sourceRoot":"","sources":["../../src/graphql/graphqlDocument.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,UAAU,eAAe,CAAC,OAAO,EAAE,UAAU;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;CACnC;AAED
|
|
1
|
+
{"version":3,"file":"graphqlDocument.d.ts","sourceRoot":"","sources":["../../src/graphql/graphqlDocument.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,UAAU,eAAe,CAAC,OAAO,EAAE,UAAU;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;CACnC;AAED;;;;GAIG;AACH,QAAA,MAAM,eAAe,GAAI,OAAO,EAAE,UAAU,QACpC,MAAM,KACX,eAAe,CAAC,OAAO,EAAE,UAAU,CAAe,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { GitHubDateRange } from '../common/date.
|
|
2
|
-
import type { RangeContributionsByRepoFragment } from './generated/stats.
|
|
1
|
+
import type { GitHubDateRange } from '../common/date.ts';
|
|
2
|
+
import type { RangeContributionsByRepoFragment } from './generated/stats.ts';
|
|
3
|
+
import type { GraphQLDocument } from './graphqlDocument.ts';
|
|
3
4
|
/** max value GitHub allows for `first/maxRepositories` */
|
|
4
5
|
declare const MAX_REPOSITORIES_LIMIT = 100;
|
|
5
6
|
interface ReposContributedToQueryVariables {
|
|
@@ -17,11 +18,9 @@ interface ReposContributedToQuery {
|
|
|
17
18
|
* Mirrors the `contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]`
|
|
18
19
|
* filter used by `repositoriesContributedTo` in `stats.graphql`.
|
|
19
20
|
*
|
|
20
|
-
* @param ranges Ranges to fetch, one `range_<index>` alias each.
|
|
21
|
-
* @param includeOwnRepos Whether to select `repositoryContributions`.
|
|
22
21
|
* @returns Document for `createGraphQLFetcher`.
|
|
23
22
|
*/
|
|
24
|
-
declare const buildReposContributedToDocument: (ranges: Array<GitHubDateRange>, includeOwnRepos: boolean) =>
|
|
23
|
+
declare const buildReposContributedToDocument: (ranges: Array<GitHubDateRange>, includeOwnRepos: boolean) => GraphQLDocument<ReposContributedToQuery, ReposContributedToQueryVariables>;
|
|
25
24
|
export { buildReposContributedToDocument, MAX_REPOSITORIES_LIMIT };
|
|
26
25
|
export type { ReposContributedToQuery };
|
|
27
26
|
//# sourceMappingURL=reposContributedToDocument.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reposContributedToDocument.d.ts","sourceRoot":"","sources":["../../src/graphql/reposContributedToDocument.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"reposContributedToDocument.d.ts","sourceRoot":"","sources":["../../src/graphql/reposContributedToDocument.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,0DAA0D;AAC1D,QAAA,MAAM,sBAAsB,MAAM,CAAC;AAEnC,UAAU,gCAAgC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,uBAAuB;IAC/B,IAAI,EAAE,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,gCAAgC,CAAC,GAAG,IAAI,CAAC;CAC1E;AAED;;;;;;;;;GASG;AACH,QAAA,MAAM,+BAA+B,WAC3B,KAAK,CAAC,eAAe,CAAC,mBACb,OAAO,KACvB,eAAe,CAAC,uBAAuB,EAAE,gCAAgC,CAgD3E,CAAC;AAEF,OAAO,EAAE,+BAA+B,EAAE,sBAAsB,EAAE,CAAC;AACnE,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aliasedRanges } from './contributionsCollection.js';
|
|
2
2
|
import { graphqlDocument } from './graphqlDocument.js';
|
|
3
3
|
/** max value GitHub allows for `first/maxRepositories` */
|
|
4
4
|
const MAX_REPOSITORIES_LIMIT = 100;
|
|
@@ -10,14 +10,9 @@ const MAX_REPOSITORIES_LIMIT = 100;
|
|
|
10
10
|
* Mirrors the `contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]`
|
|
11
11
|
* filter used by `repositoriesContributedTo` in `stats.graphql`.
|
|
12
12
|
*
|
|
13
|
-
* @param ranges Ranges to fetch, one `range_<index>` alias each.
|
|
14
|
-
* @param includeOwnRepos Whether to select `repositoryContributions`.
|
|
15
13
|
* @returns Document for `createGraphQLFetcher`.
|
|
16
14
|
*/
|
|
17
15
|
const buildReposContributedToDocument = (ranges, includeOwnRepos) => {
|
|
18
|
-
const rangeFields = ranges
|
|
19
|
-
.map(({ from, to }, index) => `range_${index}: contributionsCollection(from: "${toGitHubDateTime(from)}", to: "${toGitHubDateTime(to)}") { ...RangeContributionsByRepo }`)
|
|
20
|
-
.join('\n');
|
|
21
16
|
// `repositoryContributions` only ever returns repos the user owns,
|
|
22
17
|
// so it is left out rather than gated with @include: an excluded field still counts toward the query's node cost.
|
|
23
18
|
// stats.graphql carries the directive so the generated type marks the field optional.
|
|
@@ -34,7 +29,7 @@ const buildReposContributedToDocument = (ranges, includeOwnRepos) => {
|
|
|
34
29
|
return graphqlDocument(`
|
|
35
30
|
query userReposContributedTo($login: String!, $maxRepositories: Int!) {
|
|
36
31
|
user(login: $login) {
|
|
37
|
-
${
|
|
32
|
+
${aliasedRanges(ranges, 'RangeContributionsByRepo')}
|
|
38
33
|
}
|
|
39
34
|
}
|
|
40
35
|
fragment RangeContributionsByRepo on ContributionsCollection {
|
|
@@ -42,16 +37,25 @@ fragment RangeContributionsByRepo on ContributionsCollection {
|
|
|
42
37
|
repository {
|
|
43
38
|
nameWithOwner
|
|
44
39
|
}
|
|
40
|
+
contributions {
|
|
41
|
+
totalCount
|
|
42
|
+
}
|
|
45
43
|
}
|
|
46
44
|
issueContributionsByRepository(maxRepositories: $maxRepositories) {
|
|
47
45
|
repository {
|
|
48
46
|
nameWithOwner
|
|
49
47
|
}
|
|
48
|
+
contributions {
|
|
49
|
+
totalCount
|
|
50
|
+
}
|
|
50
51
|
}
|
|
51
52
|
pullRequestContributionsByRepository(maxRepositories: $maxRepositories) {
|
|
52
53
|
repository {
|
|
53
54
|
nameWithOwner
|
|
54
55
|
}
|
|
56
|
+
contributions {
|
|
57
|
+
totalCount
|
|
58
|
+
}
|
|
55
59
|
}
|
|
56
60
|
${ownRepoField}
|
|
57
61
|
}`);
|