@stats-organization/github-readme-stats-core 2.1.4 → 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.
Files changed (182) hide show
  1. package/build/api/gist.d.ts +2 -7
  2. package/build/api/gist.d.ts.map +1 -1
  3. package/build/api/gist.js +28 -26
  4. package/build/api/index.d.ts +3 -8
  5. package/build/api/index.d.ts.map +1 -1
  6. package/build/api/index.js +32 -36
  7. package/build/api/pin.d.ts +2 -7
  8. package/build/api/pin.d.ts.map +1 -1
  9. package/build/api/pin.js +18 -33
  10. package/build/api/top-langs.d.ts +2 -7
  11. package/build/api/top-langs.d.ts.map +1 -1
  12. package/build/api/top-langs.js +32 -44
  13. package/build/api/wakatime.d.ts +2 -7
  14. package/build/api/wakatime.d.ts.map +1 -1
  15. package/build/api/wakatime.js +28 -26
  16. package/build/calculateRank.d.ts +12 -11
  17. package/build/calculateRank.d.ts.map +1 -1
  18. package/build/calculateRank.js +18 -18
  19. package/build/cards/common-options.d.ts +13 -0
  20. package/build/cards/common-options.d.ts.map +1 -0
  21. package/build/cards/common-options.js +1 -0
  22. package/build/cards/gist.d.ts +11 -16
  23. package/build/cards/gist.d.ts.map +1 -1
  24. package/build/cards/gist.js +26 -31
  25. package/build/cards/repo.d.ts +19 -16
  26. package/build/cards/repo.d.ts.map +1 -1
  27. package/build/cards/repo.js +79 -72
  28. package/build/cards/stats.d.ts +29 -44
  29. package/build/cards/stats.d.ts.map +1 -1
  30. package/build/cards/stats.js +118 -173
  31. package/build/cards/top-languages.d.ts +81 -77
  32. package/build/cards/top-languages.d.ts.map +1 -1
  33. package/build/cards/top-languages.js +186 -184
  34. package/build/cards/wakatime.d.ts +21 -11
  35. package/build/cards/wakatime.d.ts.map +1 -1
  36. package/build/cards/wakatime.js +92 -109
  37. package/build/common/Card.d.ts +41 -14
  38. package/build/common/Card.d.ts.map +1 -1
  39. package/build/common/Card.js +92 -31
  40. package/build/common/I18n.d.ts +4 -2
  41. package/build/common/I18n.d.ts.map +1 -1
  42. package/build/common/color.d.ts +91 -15
  43. package/build/common/color.d.ts.map +1 -1
  44. package/build/common/color.js +163 -17
  45. package/build/common/config.d.ts +2 -1
  46. package/build/common/config.d.ts.map +1 -1
  47. package/build/common/config.js +16 -26
  48. package/build/common/constants.d.ts +2 -1
  49. package/build/common/constants.d.ts.map +1 -1
  50. package/build/common/date.d.ts +37 -0
  51. package/build/common/date.d.ts.map +1 -0
  52. package/build/common/date.js +31 -0
  53. package/build/common/html.js +1 -1
  54. package/build/common/http.d.ts +37 -5
  55. package/build/common/http.d.ts.map +1 -1
  56. package/build/common/http.js +29 -6
  57. package/build/common/icons.d.ts +1 -0
  58. package/build/common/icons.d.ts.map +1 -1
  59. package/build/common/icons.js +1 -0
  60. package/build/common/languageColors.d.ts +11 -0
  61. package/build/common/languageColors.d.ts.map +1 -0
  62. package/build/common/languageColors.js +15 -0
  63. package/build/common/languageColors.json +10 -1
  64. package/build/common/ops.d.ts +27 -33
  65. package/build/common/ops.d.ts.map +1 -1
  66. package/build/common/ops.js +31 -48
  67. package/build/common/render.d.ts +154 -113
  68. package/build/common/render.d.ts.map +1 -1
  69. package/build/common/render.js +209 -92
  70. package/build/common/retryer.d.ts +15 -6
  71. package/build/common/retryer.d.ts.map +1 -1
  72. package/build/common/retryer.js +2 -0
  73. package/build/fetchers/gist.d.ts +6 -21
  74. package/build/fetchers/gist.d.ts.map +1 -1
  75. package/build/fetchers/gist.js +28 -64
  76. package/build/fetchers/repo.d.ts +12 -11
  77. package/build/fetchers/repo.d.ts.map +1 -1
  78. package/build/fetchers/repo.js +27 -68
  79. package/build/fetchers/stats.d.ts +24 -17
  80. package/build/fetchers/stats.d.ts.map +1 -1
  81. package/build/fetchers/stats.js +302 -184
  82. package/build/fetchers/top-languages.d.ts +10 -15
  83. package/build/fetchers/top-languages.d.ts.map +1 -1
  84. package/build/fetchers/top-languages.js +52 -103
  85. package/build/fetchers/types.d.ts +130 -0
  86. package/build/fetchers/types.d.ts.map +1 -0
  87. package/build/fetchers/types.js +1 -0
  88. package/build/fetchers/wakatime.d.ts +9 -5
  89. package/build/fetchers/wakatime.d.ts.map +1 -1
  90. package/build/fetchers/wakatime.js +8 -4
  91. package/build/graphql/contributionsDocument.d.ts +18 -0
  92. package/build/graphql/contributionsDocument.d.ts.map +1 -0
  93. package/build/graphql/contributionsDocument.js +30 -0
  94. package/build/graphql/generated/common.d.ts +42 -0
  95. package/build/graphql/generated/common.d.ts.map +1 -0
  96. package/build/graphql/generated/common.js +2 -0
  97. package/build/graphql/generated/gist.d.ts +44 -0
  98. package/build/graphql/generated/gist.d.ts.map +1 -0
  99. package/build/graphql/generated/gist.js +27 -0
  100. package/build/graphql/generated/repo.d.ts +67 -0
  101. package/build/graphql/generated/repo.d.ts.map +1 -0
  102. package/build/graphql/generated/repo.js +30 -0
  103. package/build/graphql/generated/stats.d.ts +150 -0
  104. package/build/graphql/generated/stats.d.ts.map +1 -0
  105. package/build/graphql/generated/stats.js +95 -0
  106. package/build/graphql/generated/top-languages.d.ts +54 -0
  107. package/build/graphql/generated/top-languages.d.ts.map +1 -0
  108. package/build/graphql/generated/top-languages.js +27 -0
  109. package/build/graphql/graphqlDocument.d.ts +22 -0
  110. package/build/graphql/graphqlDocument.d.ts.map +1 -0
  111. package/build/graphql/graphqlDocument.js +8 -0
  112. package/build/graphql/reposContributedToDocument.d.ts +27 -0
  113. package/build/graphql/reposContributedToDocument.d.ts.map +1 -0
  114. package/build/graphql/reposContributedToDocument.js +59 -0
  115. package/build/index.d.ts +3 -1
  116. package/build/index.d.ts.map +1 -1
  117. package/build/index.js +2 -1
  118. package/build/themes/index.d.ts +32 -0
  119. package/build/themes/index.d.ts.map +1 -1
  120. package/build/themes/index.js +28 -0
  121. package/build/translations.d.ts +17 -0
  122. package/build/translations.d.ts.map +1 -1
  123. package/build/translations.js +17 -0
  124. package/package.json +14 -8
  125. package/src/_emoji-name-map.d.ts +10 -0
  126. package/src/_github-username-regex.d.ts +4 -0
  127. package/src/api/gist.js +31 -31
  128. package/src/api/index.js +40 -42
  129. package/src/api/pin.js +20 -38
  130. package/src/api/top-langs.js +36 -49
  131. package/src/api/wakatime.js +31 -31
  132. package/src/{calculateRank.js → calculateRank.ts} +29 -19
  133. package/src/cards/common-options.ts +13 -0
  134. package/src/cards/{gist.js → gist.ts} +37 -37
  135. package/src/cards/{repo.js → repo.ts} +107 -79
  136. package/src/cards/{stats.js → stats.ts} +173 -210
  137. package/src/cards/{top-languages.js → top-languages.ts} +325 -243
  138. package/src/cards/{wakatime.js → wakatime.ts} +158 -127
  139. package/src/common/Card.ts +123 -43
  140. package/src/common/I18n.ts +6 -2
  141. package/src/common/color.ts +240 -28
  142. package/src/common/config.ts +22 -29
  143. package/src/common/constants.ts +3 -1
  144. package/src/common/date.ts +45 -0
  145. package/src/common/html.ts +1 -1
  146. package/src/common/http.ts +71 -0
  147. package/src/common/icons.ts +1 -0
  148. package/src/common/languageColors.json +10 -1
  149. package/src/common/languageColors.ts +19 -0
  150. package/src/common/ops.ts +158 -0
  151. package/src/common/render.ts +652 -0
  152. package/src/common/retryer.ts +21 -12
  153. package/src/fetchers/gist.ts +79 -0
  154. package/src/fetchers/repo.ts +114 -0
  155. package/src/fetchers/stats.ts +743 -0
  156. package/src/fetchers/top-languages.ts +135 -0
  157. package/src/fetchers/{types.d.ts → types.ts} +28 -20
  158. package/src/fetchers/{wakatime.js → wakatime.ts} +19 -5
  159. package/src/graphql/contributionsDocument.ts +44 -0
  160. package/src/graphql/generated/common.ts +26 -0
  161. package/src/graphql/generated/gist.ts +59 -0
  162. package/src/graphql/generated/repo.ts +90 -0
  163. package/src/graphql/generated/stats.ts +194 -0
  164. package/src/graphql/generated/top-languages.ts +75 -0
  165. package/src/graphql/graphqlDocument.ts +25 -0
  166. package/src/graphql/queries/gist.graphql +25 -0
  167. package/src/graphql/queries/repo.graphql +28 -0
  168. package/src/graphql/queries/stats.graphql +120 -0
  169. package/src/graphql/queries/top-languages.graphql +34 -0
  170. package/src/graphql/reposContributedToDocument.ts +86 -0
  171. package/src/index.ts +3 -1
  172. package/src/themes/index.ts +33 -0
  173. package/src/translations.ts +17 -0
  174. package/src/cards/types.d.ts +0 -78
  175. package/src/common/http.js +0 -19
  176. package/src/common/ops.js +0 -170
  177. package/src/common/render.js +0 -440
  178. package/src/fetchers/gist.js +0 -112
  179. package/src/fetchers/repo.js +0 -161
  180. package/src/fetchers/stats.js +0 -474
  181. package/src/fetchers/top-languages.js +0 -175
  182. package/src/themes/README.md +0 -229
@@ -1,78 +1,38 @@
1
1
  import { MissingParamError } from "../common/error.js";
2
- import { request } from "../common/http.js";
2
+ import { createGraphQLFetcher } from "../common/http.js";
3
3
  import { retryer } from "../common/retryer.js";
4
- const QUERY = `
5
- query gistInfo($gistName: String!) {
6
- viewer {
7
- gist(name: $gistName) {
8
- description
9
- owner {
10
- login
11
- }
12
- stargazerCount
13
- forks {
14
- totalCount
15
- }
16
- files {
17
- name
18
- language {
19
- name
20
- }
21
- size
22
- }
23
- }
24
- }
25
- }
26
- `;
27
- /**
28
- * Gist data fetcher.
29
- *
30
- * @param {object} variables Fetcher variables.
31
- * @param {string} token GitHub token.
32
- * @returns {Promise<import('axios').AxiosResponse>} The response.
33
- */
34
- const fetcher = async (variables, token) => {
35
- return await request({ query: QUERY, variables }, { Authorization: `token ${token}` });
36
- };
37
- /**
38
- * @typedef {{ name: string; language: { name: string; }, size: number }} GistFile Gist file.
39
- */
4
+ import { GistInfoDocument } from "../graphql/generated/gist.js";
5
+ const fetcher = createGraphQLFetcher(GistInfoDocument, "token");
40
6
  /**
41
7
  * This function calculates the primary language of a gist by files size.
42
8
  *
43
- * @param {GistFile[]} files Files.
44
- * @returns {string} Primary language.
9
+ * @param files Files.
10
+ * @returns Primary language, or `null` when no file has a language.
45
11
  */
46
12
  const calculatePrimaryLanguage = (files) => {
47
- /** @type {Record<string, number>} */
48
13
  const languages = {};
49
14
  for (const file of files) {
50
15
  if (file.language) {
51
- if (languages[file.language.name]) {
52
- languages[file.language.name] += file.size;
53
- }
54
- else {
55
- languages[file.language.name] = file.size;
56
- }
16
+ languages[file.language.name] =
17
+ (languages[file.language.name] ?? 0) + (file.size ?? 0);
57
18
  }
58
19
  }
59
- let primaryLanguage = Object.keys(languages)[0];
60
- for (const language in languages) {
61
- if (languages[language] > languages[primaryLanguage]) {
20
+ let primaryLanguage = null;
21
+ let maxSize = -1;
22
+ for (const [language, size] of Object.entries(languages)) {
23
+ if (size > maxSize) {
24
+ maxSize = size;
62
25
  primaryLanguage = language;
63
26
  }
64
27
  }
65
28
  return primaryLanguage;
66
29
  };
67
- /**
68
- * @typedef {import('./types').GistData} GistData Gist data.
69
- */
70
30
  /**
71
31
  * Fetch GitHub gist information by given username and ID.
72
32
  *
73
- * @param {string} id GitHub gist ID.
74
- * @param {string | null} pat Optional PAT override.
75
- * @returns {Promise<GistData>} Gist data.
33
+ * @param id GitHub gist ID.
34
+ * @param pat Optional PAT override.
35
+ * @returns Gist data.
76
36
  */
77
37
  const fetchGist = async (id, pat = null) => {
78
38
  if (!id) {
@@ -80,19 +40,23 @@ const fetchGist = async (id, pat = null) => {
80
40
  }
81
41
  const res = await retryer(fetcher, { gistName: id }, pat);
82
42
  if (res.data.errors) {
83
- throw new Error(res.data.errors[0].message);
43
+ throw new Error(res.data.errors[0]?.message);
84
44
  }
85
- if (!res.data.data.viewer.gist) {
45
+ const gist = res.data.data.viewer.gist;
46
+ if (!gist) {
86
47
  throw new Error("Gist not found");
87
48
  }
88
- const data = res.data.data.viewer.gist;
49
+ const firstFile = gist.files?.[0];
50
+ if (!firstFile?.name) {
51
+ throw new Error("Gist has no files");
52
+ }
89
53
  return {
90
- name: data.files[Object.keys(data.files)[0]].name,
91
- nameWithOwner: `${data.owner.login}/${data.files[Object.keys(data.files)[0]].name}`,
92
- description: data.description,
93
- language: calculatePrimaryLanguage(data.files),
94
- starsCount: data.stargazerCount,
95
- forksCount: data.forks.totalCount,
54
+ name: firstFile.name,
55
+ nameWithOwner: `${gist.owner?.login ?? ""}/${firstFile.name}`,
56
+ description: gist.description,
57
+ language: calculatePrimaryLanguage(gist.files?.filter((file) => !!file) ?? []),
58
+ starsCount: gist.stargazerCount,
59
+ forksCount: gist.forks.totalCount,
96
60
  };
97
61
  };
98
62
  export { fetchGist };
@@ -1,16 +1,17 @@
1
- /**
2
- * Repository data.
3
- */
4
- export type RepositoryData = any;
5
- /**
6
- * @typedef {import("./types").RepositoryData} RepositoryData Repository data.
7
- */
1
+ import type { RepositoryData } from "./types.js";
8
2
  /**
9
3
  * Fetch repository data.
10
4
  *
11
- * @param {string} username GitHub username.
12
- * @param {string} reponame GitHub repository name.
13
- * @returns {Promise<RepositoryData>} Repository data.
5
+ * @param username GitHub username.
6
+ * @param reponame GitHub repository name.
7
+ * @param include_prs_authored Include count of PRs authored.
8
+ * @param include_prs_commented Include count of PRs commented.
9
+ * @param include_prs_reviewed Include count of PRs reviewed.
10
+ * @param include_issues_authored Include count of issues authored.
11
+ * @param include_issues_commented Include count of issues commented.
12
+ * @param pat Optional PAT override.
13
+ * @returns Repository data.
14
14
  */
15
- export function fetchRepo(username: string, reponame: string, include_prs_authored?: boolean, include_prs_commented?: boolean, include_prs_reviewed?: boolean, include_issues_authored?: boolean, include_issues_commented?: boolean, pat?: null): Promise<RepositoryData>;
15
+ declare const fetchRepo: (username: string, reponame: string, include_prs_authored?: boolean, include_prs_commented?: boolean, include_prs_reviewed?: boolean, include_issues_authored?: boolean, include_issues_commented?: boolean, pat?: string | null) => Promise<RepositoryData>;
16
+ export { fetchRepo };
16
17
  //# sourceMappingURL=repo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/fetchers/repo.js"],"names":[],"mappings":";;;;AAuDA;;GAEG;AAEH;;;;;;GAMG;AACH,oCAJW,MAAM,YACN,MAAM,uLACJ,OAAO,CAAC,cAAc,CAAC,CA8FnC"}
1
+ {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/fetchers/repo.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAMjD;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,SAAS,GACb,UAAU,MAAM,EAChB,UAAU,MAAM,EAChB,8BAA4B,EAC5B,+BAA6B,EAC7B,8BAA4B,EAC5B,iCAA+B,EAC/B,kCAAgC,EAChC,MAAK,MAAM,GAAG,IAAW,KACxB,OAAO,CAAC,cAAc,CA6ExB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,67 +1,29 @@
1
1
  import { MissingParamError } from "../common/error.js";
2
- import { request } from "../common/http.js";
2
+ import { createGraphQLFetcher } from "../common/http.js";
3
3
  import { retryer } from "../common/retryer.js";
4
+ import { GetRepoDocument } from "../graphql/generated/repo.js";
4
5
  import { fetchRepoUserStats } from "./stats.js";
5
- /**
6
- * Repo data fetcher.
7
- *
8
- * @param {object} variables Fetcher variables.
9
- * @param {string} token GitHub token.
10
- * @returns {Promise<import('axios').AxiosResponse>} The response.
11
- */
12
- const fetcher = (variables, token) => {
13
- return request({
14
- query: `
15
- fragment RepoInfo on Repository {
16
- name
17
- nameWithOwner
18
- isPrivate
19
- isArchived
20
- isTemplate
21
- stargazerCount
22
- description
23
- primaryLanguage {
24
- color
25
- id
26
- name
27
- }
28
- forkCount
29
- }
30
- query getRepo($login: String!, $repo: String!) {
31
- user(login: $login) {
32
- repository(name: $repo) {
33
- ...RepoInfo
34
- }
35
- }
36
- organization(login: $login) {
37
- repository(name: $repo) {
38
- ...RepoInfo
39
- }
40
- }
41
- }
42
- `,
43
- variables,
44
- }, {
45
- Authorization: `token ${token}`,
46
- });
47
- };
48
- const urlExample = "/api/pin?username=USERNAME&amp;repo=REPO_NAME";
49
- /**
50
- * @typedef {import("./types").RepositoryData} RepositoryData Repository data.
51
- */
6
+ const fetcher = createGraphQLFetcher(GetRepoDocument, "token");
7
+ const urlExample = "/api/pin?username=USERNAME&repo=REPO_NAME";
52
8
  /**
53
9
  * Fetch repository data.
54
10
  *
55
- * @param {string} username GitHub username.
56
- * @param {string} reponame GitHub repository name.
57
- * @returns {Promise<RepositoryData>} Repository data.
11
+ * @param username GitHub username.
12
+ * @param reponame GitHub repository name.
13
+ * @param include_prs_authored Include count of PRs authored.
14
+ * @param include_prs_commented Include count of PRs commented.
15
+ * @param include_prs_reviewed Include count of PRs reviewed.
16
+ * @param include_issues_authored Include count of issues authored.
17
+ * @param include_issues_commented Include count of issues commented.
18
+ * @param pat Optional PAT override.
19
+ * @returns Repository data.
58
20
  */
59
21
  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, pat = null) => {
60
22
  let owner = username;
61
23
  if (reponame && reponame.includes("/")) {
62
- const [parsed_owner, parsed_repo] = reponame.split("/");
63
- owner = parsed_owner;
64
- reponame = parsed_repo;
24
+ const [parsedOwner, parsedRepo] = reponame.split("/");
25
+ owner = parsedOwner ?? "";
26
+ reponame = parsedRepo ?? "";
65
27
  }
66
28
  if (owner && !username) {
67
29
  username = owner;
@@ -78,34 +40,31 @@ const fetchRepo = async (username, reponame, include_prs_authored = false, inclu
78
40
  if (!reponame) {
79
41
  throw new MissingParamError(["repo"], urlExample);
80
42
  }
81
- let res = await retryer(fetcher, { login: owner, repo: reponame }, pat);
43
+ const res = await retryer(fetcher, { login: owner, repo: reponame }, pat);
82
44
  const data = res.data.data;
83
45
  if (!data.user && !data.organization) {
84
46
  throw new Error("Not found");
85
47
  }
86
- const isUser = data.organization === null && data.user;
87
- const isOrg = data.user === null && data.organization;
88
- if (isUser) {
89
- if (!data.user.repository || data.user.repository.isPrivate) {
48
+ if (data.organization === null && data.user) {
49
+ const repository = data.user.repository;
50
+ if (!repository || repository.isPrivate) {
90
51
  throw new Error("User Repository Not found");
91
52
  }
92
- let repoUserStats = await fetchRepoUserStats(username, [owner + "/" + reponame], [], include_prs_authored, include_prs_commented, include_prs_reviewed, include_issues_authored, include_issues_commented, pat);
53
+ const repoUserStats = await fetchRepoUserStats(username, [owner + "/" + reponame], [], include_prs_authored, include_prs_commented, include_prs_reviewed, include_issues_authored, include_issues_commented, pat);
93
54
  return {
94
55
  ...repoUserStats,
95
- ...data.user.repository,
96
- starCount: data.user.repository.stargazerCount,
56
+ ...repository,
97
57
  };
98
58
  }
99
- if (isOrg) {
100
- if (!data.organization.repository ||
101
- data.organization.repository.isPrivate) {
59
+ if (data.user === null && data.organization) {
60
+ const repository = data.organization.repository;
61
+ if (!repository || repository.isPrivate) {
102
62
  throw new Error("Organization Repository Not found");
103
63
  }
104
- let repoUserStats = await fetchRepoUserStats(username, [owner + "/" + reponame], [], include_prs_authored, include_prs_commented, include_prs_reviewed, include_issues_authored, include_issues_commented, pat);
64
+ const repoUserStats = await fetchRepoUserStats(username, [owner + "/" + reponame], [], include_prs_authored, include_prs_commented, include_prs_reviewed, include_issues_authored, include_issues_commented, pat);
105
65
  return {
106
66
  ...repoUserStats,
107
- ...data.organization.repository,
108
- starCount: data.organization.repository.stargazerCount,
67
+ ...repository,
109
68
  };
110
69
  }
111
70
  throw new Error("Unexpected behavior");
@@ -1,22 +1,29 @@
1
+ import type { RepoUserStats, StatsData } from "./types.js";
2
+ declare const fetchRepoUserStats: (username: string, repo: Array<string>, owner: Array<string>, include_prs_authored: boolean, include_prs_commented: boolean, include_prs_reviewed: boolean, include_issues_authored: boolean, include_issues_commented: boolean, pat: string | null) => Promise<RepoUserStats>;
1
3
  /**
2
4
  * Fetch stats for a given username.
3
5
  *
4
- * @param {string} username GitHub username.
5
- * @param {boolean} include_all_commits Include all commits.
6
- * @param {string[]} exclude_repo Repositories to exclude.
7
- * @param {boolean} include_merged_pull_requests Include merged pull requests.
8
- * @param {boolean} include_discussions Include discussions.
9
- * @param {boolean} include_discussions_answers Include discussions answers.
10
- * @param {number|undefined} commits_year Year to count total commits
11
- * @param {string[]} ownerAffiliations Owner affiliations. Default: OWNER.
12
- * @returns {Promise<import("./types").StatsData>} Stats data.
6
+ * @param username GitHub username.
7
+ * @param include_all_commits Include all commits.
8
+ * @param exclude_repo Repositories to exclude.
9
+ * @param include_merged_pull_requests Include merged pull requests.
10
+ * @param include_discussions Include discussions.
11
+ * @param include_discussions_answers Include discussions answers.
12
+ * @param commits_year Year to count total commits.
13
+ * @param repo Repositories to scope the REST search to.
14
+ * @param owner Owners to scope the REST search to.
15
+ * @param include_prs_authored Include count of PRs authored.
16
+ * @param include_prs_commented Include count of PRs commented.
17
+ * @param include_prs_reviewed Include count of PRs reviewed.
18
+ * @param include_issues_authored Include count of issues authored.
19
+ * @param include_issues_commented Include count of issues commented.
20
+ * @param ownerAffiliations Owner affiliations. Default: OWNER.
21
+ * @param include_contributions Include all-time contributions.
22
+ * @param include_all_time_contribs Include all-time count of repos contributed to.
23
+ * @param contribs_include_own_repos Include user-owned repos in contributed-to counts.
24
+ * @param pat Optional PAT override.
25
+ * @returns Stats data.
13
26
  */
14
- export function fetchStats(username: string, include_all_commits: boolean | undefined, exclude_repo: string[] | undefined, include_merged_pull_requests: boolean | undefined, include_discussions: boolean | undefined, include_discussions_answers: boolean | undefined, commits_year: number | undefined, repo?: any[], owner?: any[], include_prs_authored?: boolean, include_prs_commented?: boolean, include_prs_reviewed?: boolean, include_issues_authored?: boolean, include_issues_commented?: boolean, ownerAffiliations?: string[], pat?: null): Promise<any>;
15
- export function fetchRepoUserStats(username: any, repo: any, owner: any, include_prs_authored: any, include_prs_commented: any, include_prs_reviewed: any, include_issues_authored: any, include_issues_commented: any, pat: any): Promise<{
16
- totalPRsAuthored: number;
17
- totalPRsCommented: number;
18
- totalPRsReviewed: number;
19
- totalIssuesAuthored: number;
20
- totalIssuesCommented: number;
21
- }>;
27
+ declare const fetchStats: (username: string, include_all_commits?: boolean, exclude_repo?: Array<string>, include_merged_pull_requests?: boolean, include_discussions?: boolean, include_discussions_answers?: boolean, commits_year?: number, repo?: Array<string>, owner?: Array<string>, include_prs_authored?: boolean, include_prs_commented?: boolean, include_prs_reviewed?: boolean, include_issues_authored?: boolean, include_issues_commented?: boolean, ownerAffiliations?: Array<string>, include_contributions?: boolean, include_all_time_contribs?: boolean, contribs_include_own_repos?: boolean, pat?: string | null) => Promise<StatsData>;
28
+ export { fetchStats, fetchRepoUserStats };
22
29
  //# sourceMappingURL=stats.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/fetchers/stats.js"],"names":[],"mappings":"AAmTA;;;;;;;;;;;;GAYG;AACH,qCAVW,MAAM,uBACN,OAAO,4BACP,MAAM,EAAE,4CACR,OAAO,mCACP,OAAO,2CACP,OAAO,4BACP,MAAM,GAAC,SAAS,2NAChB,MAAM,EAAE,eACN,OAAO,CAAC,GAA2B,CAAC,CAyJhD;AArOD;;;;;;GA+DC"}
1
+ {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/fetchers/stats.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAgM3D,QAAA,MAAM,kBAAkB,GACtB,UAAU,MAAM,EAChB,MAAM,KAAK,CAAC,MAAM,CAAC,EACnB,OAAO,KAAK,CAAC,MAAM,CAAC,EACpB,sBAAsB,OAAO,EAC7B,uBAAuB,OAAO,EAC9B,sBAAsB,OAAO,EAC7B,yBAAyB,OAAO,EAChC,0BAA0B,OAAO,EACjC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,aAAa,CAqDvB,CAAC;AAiQF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,QAAA,MAAM,UAAU,GACd,UAAU,MAAM,EAChB,6BAA2B,EAC3B,eAAc,KAAK,CAAC,MAAM,CAAM,EAChC,sCAAoC,EACpC,6BAA2B,EAC3B,qCAAmC,EACnC,eAAe,MAAM,EACrB,OAAM,KAAK,CAAC,MAAM,CAAM,EACxB,QAAO,KAAK,CAAC,MAAM,CAAM,EACzB,8BAA4B,EAC5B,+BAA6B,EAC7B,8BAA4B,EAC5B,iCAA+B,EAC/B,kCAAgC,EAChC,oBAAmB,KAAK,CAAC,MAAM,CAAM,EACrC,+BAA6B,EAC7B,mCAAiC,EACjC,oCAAkC,EAClC,MAAK,MAAM,GAAG,IAAW,KACxB,OAAO,CAAC,SAAS,CA2JnB,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC"}