@stats-forge/github-stats-forge-core 0.0.1
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/LICENSE +21 -0
- package/README.md +148 -0
- package/build/api/api-result.d.ts +44 -0
- package/build/api/api-result.d.ts.map +1 -0
- package/build/api/api-result.js +33 -0
- package/build/api/gist.d.ts +29 -0
- package/build/api/gist.d.ts.map +1 -0
- package/build/api/gist.js +52 -0
- package/build/api/index.d.ts +13 -0
- package/build/api/index.d.ts.map +1 -0
- package/build/api/index.js +8 -0
- package/build/api/params.d.ts +93 -0
- package/build/api/params.d.ts.map +1 -0
- package/build/api/params.js +145 -0
- package/build/api/pin.d.ts +47 -0
- package/build/api/pin.d.ts.map +1 -0
- package/build/api/pin.js +87 -0
- package/build/api/stats.d.ts +42 -0
- package/build/api/stats.d.ts.map +1 -0
- package/build/api/stats.js +132 -0
- package/build/api/top-langs.d.ts +37 -0
- package/build/api/top-langs.d.ts.map +1 -0
- package/build/api/top-langs.js +101 -0
- package/build/api/wakatime.d.ts +34 -0
- package/build/api/wakatime.d.ts.map +1 -0
- package/build/api/wakatime.js +91 -0
- package/build/calculateRank.d.ts +29 -0
- package/build/calculateRank.d.ts.map +1 -0
- package/build/calculateRank.js +58 -0
- package/build/cards/gist.d.ts +16 -0
- package/build/cards/gist.d.ts.map +1 -0
- package/build/cards/gist.js +119 -0
- package/build/cards/index.d.ts +11 -0
- package/build/cards/index.d.ts.map +1 -0
- package/build/cards/index.js +7 -0
- package/build/cards/options.d.ts +19 -0
- package/build/cards/options.d.ts.map +1 -0
- package/build/cards/options.js +1 -0
- package/build/cards/repo.d.ts +25 -0
- package/build/cards/repo.d.ts.map +1 -0
- package/build/cards/repo.js +276 -0
- package/build/cards/stats.d.ts +37 -0
- package/build/cards/stats.d.ts.map +1 -0
- package/build/cards/stats.js +457 -0
- package/build/cards/top-languages.d.ts +153 -0
- package/build/cards/top-languages.d.ts.map +1 -0
- package/build/cards/top-languages.js +805 -0
- package/build/cards/wakatime.d.ts +31 -0
- package/build/cards/wakatime.d.ts.map +1 -0
- package/build/cards/wakatime.js +376 -0
- package/build/common/Card.d.ts +121 -0
- package/build/common/Card.d.ts.map +1 -0
- package/build/common/Card.js +305 -0
- package/build/common/I18n.d.ts +27 -0
- package/build/common/I18n.d.ts.map +1 -0
- package/build/common/I18n.js +35 -0
- package/build/common/color.d.ts +112 -0
- package/build/common/color.d.ts.map +1 -0
- package/build/common/color.js +188 -0
- package/build/common/config.d.ts +53 -0
- package/build/common/config.d.ts.map +1 -0
- package/build/common/config.js +87 -0
- package/build/common/constants.d.ts +7 -0
- package/build/common/constants.d.ts.map +1 -0
- package/build/common/constants.js +9 -0
- package/build/common/date.d.ts +29 -0
- package/build/common/date.d.ts.map +1 -0
- package/build/common/date.js +23 -0
- package/build/common/error.d.ts +87 -0
- package/build/common/error.d.ts.map +1 -0
- package/build/common/error.js +108 -0
- package/build/common/fmt.d.ts +28 -0
- package/build/common/fmt.d.ts.map +1 -0
- package/build/common/fmt.js +68 -0
- package/build/common/html.d.ts +8 -0
- package/build/common/html.d.ts.map +1 -0
- package/build/common/html.js +14 -0
- package/build/common/http.d.ts +53 -0
- package/build/common/http.d.ts.map +1 -0
- package/build/common/http.js +47 -0
- package/build/common/icons.d.ts +28 -0
- package/build/common/icons.d.ts.map +1 -0
- package/build/common/icons.js +77 -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 +678 -0
- package/build/common/log.d.ts +9 -0
- package/build/common/log.d.ts.map +1 -0
- package/build/common/log.js +8 -0
- package/build/common/ops.d.ts +59 -0
- package/build/common/ops.d.ts.map +1 -0
- package/build/common/ops.js +115 -0
- package/build/common/render.d.ts +196 -0
- package/build/common/render.d.ts.map +1 -0
- package/build/common/render.js +474 -0
- package/build/common/retryer.d.ts +36 -0
- package/build/common/retryer.d.ts.map +1 -0
- package/build/common/retryer.js +67 -0
- package/build/fetchers/gist.d.ts +15 -0
- package/build/fetchers/gist.d.ts.map +1 -0
- package/build/fetchers/gist.js +68 -0
- package/build/fetchers/index.d.ts +13 -0
- package/build/fetchers/index.d.ts.map +1 -0
- package/build/fetchers/index.js +10 -0
- package/build/fetchers/repo.d.ts +27 -0
- package/build/fetchers/repo.d.ts.map +1 -0
- package/build/fetchers/repo.js +100 -0
- package/build/fetchers/stats.d.ts +74 -0
- package/build/fetchers/stats.d.ts.map +1 -0
- package/build/fetchers/stats.js +498 -0
- package/build/fetchers/top-languages.d.ts +23 -0
- package/build/fetchers/top-languages.d.ts.map +1 -0
- package/build/fetchers/top-languages.js +89 -0
- package/build/fetchers/types.d.ts +130 -0
- package/build/fetchers/types.d.ts.map +1 -0
- package/build/fetchers/types.js +1 -0
- package/build/fetchers/wakatime.d.ts +19 -0
- package/build/fetchers/wakatime.d.ts.map +1 -0
- package/build/fetchers/wakatime.js +36 -0
- 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 +15 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +10 -0
- package/build/themes/index.d.ts +505 -0
- package/build/themes/index.d.ts.map +1 -0
- package/build/themes/index.js +505 -0
- package/build/translations.d.ts +1153 -0
- package/build/translations.d.ts.map +1 -0
- package/build/translations.js +1156 -0
- package/package.json +114 -0
- package/src/_emoji-name-map.d.ts +10 -0
- package/src/_github-username-regex.d.ts +4 -0
- package/src/api/api-result.ts +69 -0
- package/src/api/gist.ts +66 -0
- package/src/api/index.ts +16 -0
- package/src/api/params.ts +221 -0
- package/src/api/pin.ts +126 -0
- package/src/api/stats.ts +195 -0
- package/src/api/top-langs.ts +150 -0
- package/src/api/wakatime.ts +130 -0
- package/src/calculateRank.ts +91 -0
- package/src/cards/gist.ts +169 -0
- package/src/cards/index.ts +21 -0
- package/src/cards/options.ts +18 -0
- package/src/cards/repo.ts +376 -0
- package/src/cards/stats.ts +615 -0
- package/src/cards/top-languages.ts +1077 -0
- package/src/cards/wakatime.ts +501 -0
- package/src/common/Card.ts +364 -0
- package/src/common/I18n.ts +51 -0
- package/src/common/color.ts +296 -0
- package/src/common/config.ts +118 -0
- package/src/common/constants.ts +12 -0
- package/src/common/date.ts +34 -0
- package/src/common/error.ts +163 -0
- package/src/common/fmt.ts +86 -0
- package/src/common/html.ts +17 -0
- package/src/common/http.ts +98 -0
- package/src/common/icons.ts +80 -0
- package/src/common/languageColors.json +678 -0
- package/src/common/languageColors.ts +19 -0
- package/src/common/log.ts +12 -0
- package/src/common/ops.ts +145 -0
- package/src/common/render.ts +641 -0
- package/src/common/retryer.ts +111 -0
- package/src/fetchers/gist.ts +82 -0
- package/src/fetchers/index.ts +25 -0
- package/src/fetchers/repo.ts +140 -0
- package/src/fetchers/stats.ts +742 -0
- package/src/fetchers/top-languages.ts +134 -0
- package/src/fetchers/types.ts +136 -0
- package/src/fetchers/wakatime.ts +56 -0
- package/src/graphql/contributionsDocument.ts +44 -0
- package/src/graphql/generated/common.ts +26 -0
- package/src/graphql/generated/gist.ts +56 -0
- package/src/graphql/generated/repo.ts +79 -0
- package/src/graphql/generated/stats.ts +180 -0
- package/src/graphql/generated/top-languages.ts +66 -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 +113 -0
- package/src/graphql/queries/top-languages.graphql +27 -0
- package/src/graphql/reposContributedToDocument.ts +83 -0
- package/src/index.ts +18 -0
- package/src/themes/index.ts +519 -0
- package/src/translations.ts +1169 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { fetchGist } from './gist.js';
|
|
2
|
+
export { fetchRepo } from './repo.js';
|
|
3
|
+
export { fetchRepoUserStats, fetchStats } from './stats.js';
|
|
4
|
+
export { fetchTopLanguages } from './top-languages.js';
|
|
5
|
+
export { fetchWakatimeStats } from './wakatime.js';
|
|
6
|
+
export type { GistData, Lang, RepoUserStats, RepositoryData, StatsData, TopLangData, WakaTimeData, WakaTimeLang, } from './types.js';
|
|
7
|
+
export { CardConfig } from '../common/config.js';
|
|
8
|
+
export type { CardConfigInit, PersonalAccessToken } from '../common/config.js';
|
|
9
|
+
export type { FetchLike } from '../common/http.js';
|
|
10
|
+
export { retryer } from '../common/retryer.js';
|
|
11
|
+
export { CardError } from '../common/error.js';
|
|
12
|
+
export type { ErrorCode } from '../common/error.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fetchers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,YAAY,EACV,QAAQ,EACR,IAAI,EACJ,aAAa,EACb,cAAc,EACd,SAAS,EACT,WAAW,EACX,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { fetchGist } from './gist.js';
|
|
2
|
+
export { fetchRepo } from './repo.js';
|
|
3
|
+
export { fetchRepoUserStats, fetchStats } from './stats.js';
|
|
4
|
+
export { fetchTopLanguages } from './top-languages.js';
|
|
5
|
+
export { fetchWakatimeStats } from './wakatime.js';
|
|
6
|
+
// every fetcher takes a config, so this entry carries it rather than sending a
|
|
7
|
+
// consumer back to the package root for it.
|
|
8
|
+
export { CardConfig } from '../common/config.js';
|
|
9
|
+
export { retryer } from '../common/retryer.js';
|
|
10
|
+
export { CardError } from '../common/error.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CardConfig } from '../common/config.js';
|
|
2
|
+
import type { RepositoryData } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Fetch repository data.
|
|
5
|
+
*
|
|
6
|
+
* @param props Fetcher props.
|
|
7
|
+
* @param props.username GitHub username.
|
|
8
|
+
* @param props.reponame GitHub repository name.
|
|
9
|
+
* @param props.include_prs_authored Include count of PRs authored.
|
|
10
|
+
* @param props.include_prs_commented Include count of PRs commented.
|
|
11
|
+
* @param props.include_prs_reviewed Include count of PRs reviewed.
|
|
12
|
+
* @param props.include_issues_authored Include count of issues authored.
|
|
13
|
+
* @param props.include_issues_commented Include count of issues commented.
|
|
14
|
+
* @param config Deployment config supplying the PAT pool.
|
|
15
|
+
* @returns Repository data.
|
|
16
|
+
*/
|
|
17
|
+
declare const fetchRepo: ({ username, reponame, include_prs_authored, include_prs_commented, include_prs_reviewed, include_issues_authored, include_issues_commented, }: {
|
|
18
|
+
username: string | undefined;
|
|
19
|
+
reponame: string | undefined;
|
|
20
|
+
include_prs_authored?: boolean | undefined;
|
|
21
|
+
include_prs_commented?: boolean | undefined;
|
|
22
|
+
include_prs_reviewed?: boolean | undefined;
|
|
23
|
+
include_issues_authored?: boolean | undefined;
|
|
24
|
+
include_issues_commented?: boolean | undefined;
|
|
25
|
+
}, config: CardConfig) => Promise<RepositoryData>;
|
|
26
|
+
export { fetchRepo };
|
|
27
|
+
//# sourceMappingURL=repo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/fetchers/repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAOtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAMjD;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,SAAS,GACb,+IAQG;IACD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3C,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5C,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3C,uBAAuB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9C,wBAAwB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChD,EACD,QAAQ,UAAU,KACjB,OAAO,CAAC,cAAc,CA2FxB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { CardError, REPO_NOT_FOUND } from '../common/error.js';
|
|
2
|
+
import { createGraphQLFetcher } from '../common/http.js';
|
|
3
|
+
import { retryer } from '../common/retryer.js';
|
|
4
|
+
import { GetRepoDocument } from '../graphql/generated/repo.js';
|
|
5
|
+
import { fetchRepoUserStats } from './stats.js';
|
|
6
|
+
const fetcher = createGraphQLFetcher(GetRepoDocument, 'token');
|
|
7
|
+
const urlExample = '/api/pin?username=USERNAME&repo=REPO_NAME';
|
|
8
|
+
/**
|
|
9
|
+
* Fetch repository data.
|
|
10
|
+
*
|
|
11
|
+
* @param props Fetcher props.
|
|
12
|
+
* @param props.username GitHub username.
|
|
13
|
+
* @param props.reponame GitHub repository name.
|
|
14
|
+
* @param props.include_prs_authored Include count of PRs authored.
|
|
15
|
+
* @param props.include_prs_commented Include count of PRs commented.
|
|
16
|
+
* @param props.include_prs_reviewed Include count of PRs reviewed.
|
|
17
|
+
* @param props.include_issues_authored Include count of issues authored.
|
|
18
|
+
* @param props.include_issues_commented Include count of issues commented.
|
|
19
|
+
* @param config Deployment config supplying the PAT pool.
|
|
20
|
+
* @returns Repository data.
|
|
21
|
+
*/
|
|
22
|
+
const fetchRepo = async ({ username, reponame, include_prs_authored = false, include_prs_commented = false, include_prs_reviewed = false, include_issues_authored = false, include_issues_commented = false, }, config) => {
|
|
23
|
+
let owner = username;
|
|
24
|
+
if (reponame && reponame.includes('/')) {
|
|
25
|
+
const [parsedOwner, parsedRepo] = reponame.split('/');
|
|
26
|
+
owner = parsedOwner ?? '';
|
|
27
|
+
reponame = parsedRepo ?? '';
|
|
28
|
+
}
|
|
29
|
+
if (owner && !username) {
|
|
30
|
+
username = owner;
|
|
31
|
+
}
|
|
32
|
+
if (username && !owner) {
|
|
33
|
+
owner = username;
|
|
34
|
+
}
|
|
35
|
+
if (!username && !reponame) {
|
|
36
|
+
throw CardError.missingParam(['username', 'repo'], urlExample);
|
|
37
|
+
}
|
|
38
|
+
if (!username) {
|
|
39
|
+
throw CardError.missingParam(['username'], urlExample);
|
|
40
|
+
}
|
|
41
|
+
if (!reponame) {
|
|
42
|
+
throw CardError.missingParam(['repo'], urlExample);
|
|
43
|
+
}
|
|
44
|
+
// the guards above leave `username` set, and `owner` mirrors it when `repo` carried none
|
|
45
|
+
const repoOwner = owner ?? username;
|
|
46
|
+
const res = await retryer(fetcher, { login: repoOwner, repo: reponame }, config);
|
|
47
|
+
const data = res.data.data;
|
|
48
|
+
if (!data.user && !data.organization) {
|
|
49
|
+
throw new CardError('Not found', {
|
|
50
|
+
code: 'not_found',
|
|
51
|
+
secondaryMessage: REPO_NOT_FOUND,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (data.organization === null && data.user) {
|
|
55
|
+
const repository = data.user.repository;
|
|
56
|
+
if (!repository || repository.isPrivate) {
|
|
57
|
+
throw new CardError('User Repository Not found', {
|
|
58
|
+
code: 'not_found',
|
|
59
|
+
secondaryMessage: REPO_NOT_FOUND,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const repoUserStats = await fetchRepoUserStats({
|
|
63
|
+
username,
|
|
64
|
+
repo: [`${repoOwner}/${reponame}`],
|
|
65
|
+
include_prs_authored,
|
|
66
|
+
include_prs_commented,
|
|
67
|
+
include_prs_reviewed,
|
|
68
|
+
include_issues_authored,
|
|
69
|
+
include_issues_commented,
|
|
70
|
+
}, config);
|
|
71
|
+
return {
|
|
72
|
+
...repoUserStats,
|
|
73
|
+
...repository,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
if (data.user === null && data.organization) {
|
|
77
|
+
const repository = data.organization.repository;
|
|
78
|
+
if (!repository || repository.isPrivate) {
|
|
79
|
+
throw new CardError('Organization Repository Not found', {
|
|
80
|
+
code: 'not_found',
|
|
81
|
+
secondaryMessage: REPO_NOT_FOUND,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const repoUserStats = await fetchRepoUserStats({
|
|
85
|
+
username,
|
|
86
|
+
repo: [`${repoOwner}/${reponame}`],
|
|
87
|
+
include_prs_authored,
|
|
88
|
+
include_prs_commented,
|
|
89
|
+
include_prs_reviewed,
|
|
90
|
+
include_issues_authored,
|
|
91
|
+
include_issues_commented,
|
|
92
|
+
}, config);
|
|
93
|
+
return {
|
|
94
|
+
...repoUserStats,
|
|
95
|
+
...repository,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
throw new CardError('Unexpected behavior', { code: 'upstream' });
|
|
99
|
+
};
|
|
100
|
+
export { fetchRepo };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { CardConfig } from '../common/config.js';
|
|
2
|
+
import type { RepoUserStats, StatsData } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Fetch the per-repository counts the REST search API answers, one request each.
|
|
5
|
+
*
|
|
6
|
+
* @param props Fetcher props.
|
|
7
|
+
* @param props.username GitHub username.
|
|
8
|
+
* @param props.repo Repositories the search is scoped to.
|
|
9
|
+
* @param props.owner Owners the search is scoped to.
|
|
10
|
+
* @param props.include_prs_authored Include count of PRs authored.
|
|
11
|
+
* @param props.include_prs_commented Include count of PRs commented.
|
|
12
|
+
* @param props.include_prs_reviewed Include count of PRs reviewed.
|
|
13
|
+
* @param props.include_issues_authored Include count of issues authored.
|
|
14
|
+
* @param props.include_issues_commented Include count of issues commented.
|
|
15
|
+
* @param config Deployment config supplying the PAT pool.
|
|
16
|
+
* @returns Only the counts that were asked for.
|
|
17
|
+
*/
|
|
18
|
+
declare const fetchRepoUserStats: ({ username, repo, owner, include_prs_authored, include_prs_commented, include_prs_reviewed, include_issues_authored, include_issues_commented, }: {
|
|
19
|
+
username: string;
|
|
20
|
+
repo?: Array<string>;
|
|
21
|
+
owner?: Array<string>;
|
|
22
|
+
include_prs_authored?: boolean | undefined;
|
|
23
|
+
include_prs_commented?: boolean | undefined;
|
|
24
|
+
include_prs_reviewed?: boolean | undefined;
|
|
25
|
+
include_issues_authored?: boolean | undefined;
|
|
26
|
+
include_issues_commented?: boolean | undefined;
|
|
27
|
+
}, config: CardConfig) => Promise<RepoUserStats>;
|
|
28
|
+
/**
|
|
29
|
+
* Fetch stats for a given username.
|
|
30
|
+
*
|
|
31
|
+
* @param props Fetcher props.
|
|
32
|
+
* @param props.username GitHub username.
|
|
33
|
+
* @param props.include_all_commits Include all commits.
|
|
34
|
+
* @param props.exclude_repo Repositories to exclude.
|
|
35
|
+
* @param props.include_merged_pull_requests Include merged pull requests.
|
|
36
|
+
* @param props.include_discussions Include discussions.
|
|
37
|
+
* @param props.include_discussions_answers Include discussions answers.
|
|
38
|
+
* @param props.commits_year Year to count total commits.
|
|
39
|
+
* @param props.repo Repositories to scope the REST search to.
|
|
40
|
+
* @param props.owner Owners to scope the REST search to.
|
|
41
|
+
* @param props.include_prs_authored Include count of PRs authored.
|
|
42
|
+
* @param props.include_prs_commented Include count of PRs commented.
|
|
43
|
+
* @param props.include_prs_reviewed Include count of PRs reviewed.
|
|
44
|
+
* @param props.include_issues_authored Include count of issues authored.
|
|
45
|
+
* @param props.include_issues_commented Include count of issues commented.
|
|
46
|
+
* @param props.ownerAffiliations Owner affiliations. Default: OWNER.
|
|
47
|
+
* @param props.include_contributions Include all-time contributions.
|
|
48
|
+
* @param props.include_all_time_contribs Include all-time count of repos contributed to.
|
|
49
|
+
* @param props.contribs_include_own_repos Include user-owned repos in contributed-to counts.
|
|
50
|
+
* @param config Deployment config supplying the PAT pool.
|
|
51
|
+
* @returns Stats data.
|
|
52
|
+
*/
|
|
53
|
+
declare const fetchStats: ({ username, include_all_commits, exclude_repo, include_merged_pull_requests, include_discussions, include_discussions_answers, commits_year, repo, owner, include_prs_authored, include_prs_commented, include_prs_reviewed, include_issues_authored, include_issues_commented, ownerAffiliations, include_contributions, include_all_time_contribs, contribs_include_own_repos, }: {
|
|
54
|
+
username: string | undefined;
|
|
55
|
+
include_all_commits?: boolean | undefined;
|
|
56
|
+
exclude_repo?: Array<string>;
|
|
57
|
+
include_merged_pull_requests?: boolean;
|
|
58
|
+
include_discussions?: boolean;
|
|
59
|
+
include_discussions_answers?: boolean;
|
|
60
|
+
commits_year?: number | undefined;
|
|
61
|
+
repo?: Array<string>;
|
|
62
|
+
owner?: Array<string>;
|
|
63
|
+
include_prs_authored?: boolean;
|
|
64
|
+
include_prs_commented?: boolean;
|
|
65
|
+
include_prs_reviewed?: boolean;
|
|
66
|
+
include_issues_authored?: boolean;
|
|
67
|
+
include_issues_commented?: boolean;
|
|
68
|
+
ownerAffiliations?: Array<string>;
|
|
69
|
+
include_contributions?: boolean;
|
|
70
|
+
include_all_time_contribs?: boolean;
|
|
71
|
+
contribs_include_own_repos?: boolean | undefined;
|
|
72
|
+
}, config: CardConfig) => Promise<StatsData>;
|
|
73
|
+
export { fetchStats, fetchRepoUserStats };
|
|
74
|
+
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/fetchers/stats.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAuBtD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA+M3D;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,kBAAkB,GACtB,kJASG;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3C,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5C,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3C,uBAAuB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9C,wBAAwB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChD,EACD,QAAQ,UAAU,KACjB,OAAO,CAAC,aAAa,CA+DvB,CAAC;AAsLF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,QAAA,MAAM,UAAU,GACd,oXAmBG;IACD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,mBAAmB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1C,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,iBAAiB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAClC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,0BAA0B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAClD,EACD,QAAQ,UAAU,KACjB,OAAO,CAAC,SAAS,CA+JnB,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC"}
|