@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.
Files changed (249) hide show
  1. package/README.md +0 -10
  2. package/build/api/api-result.d.ts +6 -7
  3. package/build/api/api-result.d.ts.map +1 -1
  4. package/build/api/api-result.js +4 -5
  5. package/build/api/contributed-to.d.ts +23 -0
  6. package/build/api/contributed-to.d.ts.map +1 -0
  7. package/build/api/contributed-to.js +43 -0
  8. package/build/api/gist.d.ts +8 -22
  9. package/build/api/gist.d.ts.map +1 -1
  10. package/build/api/gist.js +14 -36
  11. package/build/api/handler.d.ts +16 -0
  12. package/build/api/handler.d.ts.map +1 -0
  13. package/build/api/handler.js +29 -0
  14. package/build/api/index.d.ts +13 -12
  15. package/build/api/index.d.ts.map +1 -1
  16. package/build/api/index.js +1 -0
  17. package/build/api/params.d.ts +21 -12
  18. package/build/api/params.d.ts.map +1 -1
  19. package/build/api/params.js +41 -19
  20. package/build/api/pin.d.ts +11 -31
  21. package/build/api/pin.d.ts.map +1 -1
  22. package/build/api/pin.js +35 -63
  23. package/build/api/stats.d.ts +15 -16
  24. package/build/api/stats.d.ts.map +1 -1
  25. package/build/api/stats.js +60 -99
  26. package/build/api/top-langs.d.ts +13 -18
  27. package/build/api/top-langs.d.ts.map +1 -1
  28. package/build/api/top-langs.js +35 -72
  29. package/build/api/wakatime.d.ts +11 -17
  30. package/build/api/wakatime.d.ts.map +1 -1
  31. package/build/api/wakatime.js +27 -64
  32. package/build/calculateRank.d.ts +0 -9
  33. package/build/calculateRank.d.ts.map +1 -1
  34. package/build/calculateRank.js +12 -17
  35. package/build/cards/contributed-to.d.ts +19 -0
  36. package/build/cards/contributed-to.d.ts.map +1 -0
  37. package/build/cards/contributed-to.js +242 -0
  38. package/build/cards/gist.d.ts +3 -4
  39. package/build/cards/gist.d.ts.map +1 -1
  40. package/build/cards/gist.js +38 -43
  41. package/build/cards/options.d.ts +1 -1
  42. package/build/cards/repo.d.ts +14 -5
  43. package/build/cards/repo.d.ts.map +1 -1
  44. package/build/cards/repo.js +93 -103
  45. package/build/cards/stats.d.ts +18 -11
  46. package/build/cards/stats.d.ts.map +1 -1
  47. package/build/cards/stats.js +191 -222
  48. package/build/cards/top-languages.d.ts +18 -33
  49. package/build/cards/top-languages.d.ts.map +1 -1
  50. package/build/cards/top-languages.js +196 -387
  51. package/build/cards/wakatime.d.ts +17 -8
  52. package/build/cards/wakatime.d.ts.map +1 -1
  53. package/build/cards/wakatime.js +133 -187
  54. package/build/common/Card.d.ts +20 -59
  55. package/build/common/Card.d.ts.map +1 -1
  56. package/build/common/Card.js +131 -198
  57. package/build/common/I18n.d.ts +1 -7
  58. package/build/common/I18n.d.ts.map +1 -1
  59. package/build/common/I18n.js +7 -8
  60. package/build/common/brand.d.ts +76 -0
  61. package/build/common/brand.d.ts.map +1 -0
  62. package/build/common/brand.js +73 -0
  63. package/build/common/color.d.ts +4 -17
  64. package/build/common/color.d.ts.map +1 -1
  65. package/build/common/color.js +67 -49
  66. package/build/common/config.d.ts +4 -14
  67. package/build/common/config.d.ts.map +1 -1
  68. package/build/common/config.js +3 -16
  69. package/build/common/constants.d.ts +6 -2
  70. package/build/common/constants.d.ts.map +1 -1
  71. package/build/common/constants.js +5 -1
  72. package/build/common/date.d.ts +50 -5
  73. package/build/common/date.d.ts.map +1 -1
  74. package/build/common/date.js +104 -4
  75. package/build/common/emojiMap.d.ts +8 -0
  76. package/build/common/emojiMap.d.ts.map +1 -0
  77. package/build/common/emojiMap.js +10 -0
  78. package/build/common/emojiMap.json +1915 -0
  79. package/build/common/error.d.ts +1 -10
  80. package/build/common/error.d.ts.map +1 -1
  81. package/build/common/error.js +1 -10
  82. package/build/common/fmt.d.ts +3 -15
  83. package/build/common/fmt.d.ts.map +1 -1
  84. package/build/common/fmt.js +7 -35
  85. package/build/common/http.d.ts +2 -7
  86. package/build/common/http.d.ts.map +1 -1
  87. package/build/common/http.js +8 -17
  88. package/build/common/icons.d.ts +20 -20
  89. package/build/common/icons.d.ts.map +1 -1
  90. package/build/common/icons.js +108 -67
  91. package/build/common/languageColors.d.ts +0 -1
  92. package/build/common/languageColors.d.ts.map +1 -1
  93. package/build/common/languageColors.js +1 -4
  94. package/build/common/languageColors.json +18 -2
  95. package/build/common/ops.d.ts +11 -17
  96. package/build/common/ops.d.ts.map +1 -1
  97. package/build/common/ops.js +22 -39
  98. package/build/common/render.d.ts +34 -82
  99. package/build/common/render.d.ts.map +1 -1
  100. package/build/common/render.js +225 -259
  101. package/build/common/retryer.d.ts +2 -7
  102. package/build/common/retryer.d.ts.map +1 -1
  103. package/build/common/retryer.js +4 -11
  104. package/build/fetchers/contributed-to.d.ts +62 -0
  105. package/build/fetchers/contributed-to.d.ts.map +1 -0
  106. package/build/fetchers/contributed-to.js +184 -0
  107. package/build/fetchers/gist.d.ts +2 -5
  108. package/build/fetchers/gist.d.ts.map +1 -1
  109. package/build/fetchers/gist.js +1 -5
  110. package/build/fetchers/graphql-error.d.ts +13 -0
  111. package/build/fetchers/graphql-error.d.ts.map +1 -0
  112. package/build/fetchers/graphql-error.js +29 -0
  113. package/build/fetchers/index.d.ts +13 -12
  114. package/build/fetchers/index.d.ts.map +1 -1
  115. package/build/fetchers/index.js +1 -0
  116. package/build/fetchers/repo.d.ts +2 -11
  117. package/build/fetchers/repo.d.ts.map +1 -1
  118. package/build/fetchers/repo.js +20 -33
  119. package/build/fetchers/stats.d.ts +16 -40
  120. package/build/fetchers/stats.d.ts.map +1 -1
  121. package/build/fetchers/stats.js +89 -271
  122. package/build/fetchers/top-languages.d.ts +2 -9
  123. package/build/fetchers/top-languages.d.ts.map +1 -1
  124. package/build/fetchers/top-languages.js +16 -47
  125. package/build/fetchers/types.d.ts +25 -1
  126. package/build/fetchers/types.d.ts.map +1 -1
  127. package/build/fetchers/wakatime.d.ts +2 -6
  128. package/build/fetchers/wakatime.d.ts.map +1 -1
  129. package/build/fetchers/wakatime.js +1 -5
  130. package/build/graphql/contributionsCollection.d.ts +9 -0
  131. package/build/graphql/contributionsCollection.d.ts.map +1 -0
  132. package/build/graphql/contributionsCollection.js +12 -0
  133. package/build/graphql/contributionsDocument.d.ts +6 -6
  134. package/build/graphql/contributionsDocument.d.ts.map +1 -1
  135. package/build/graphql/contributionsDocument.js +8 -16
  136. package/build/graphql/generated/contributed-to.d.ts +22 -0
  137. package/build/graphql/generated/contributed-to.d.ts.map +1 -0
  138. package/build/graphql/generated/contributed-to.js +11 -0
  139. package/build/graphql/generated/gist.d.ts +1 -1
  140. package/build/graphql/generated/repo.d.ts +1 -1
  141. package/build/graphql/generated/stats.d.ts +16 -4
  142. package/build/graphql/generated/stats.d.ts.map +1 -1
  143. package/build/graphql/generated/stats.js +2 -2
  144. package/build/graphql/generated/top-languages.d.ts +2 -2
  145. package/build/graphql/graphqlDocument.d.ts +1 -2
  146. package/build/graphql/graphqlDocument.d.ts.map +1 -1
  147. package/build/graphql/graphqlDocument.js +0 -1
  148. package/build/graphql/reposContributedToDocument.d.ts +4 -5
  149. package/build/graphql/reposContributedToDocument.d.ts.map +1 -1
  150. package/build/graphql/reposContributedToDocument.js +11 -7
  151. package/build/markup/css.d.ts +35 -0
  152. package/build/markup/css.d.ts.map +1 -0
  153. package/build/markup/css.js +64 -0
  154. package/build/markup/element.d.ts +41 -0
  155. package/build/markup/element.d.ts.map +1 -0
  156. package/build/markup/element.js +127 -0
  157. package/build/markup/html.d.ts +13 -0
  158. package/build/markup/html.d.ts.map +1 -0
  159. package/build/markup/html.js +27 -0
  160. package/build/markup/index.d.ts +9 -0
  161. package/build/markup/index.d.ts.map +1 -0
  162. package/build/markup/index.js +6 -0
  163. package/build/markup/serialize.d.ts +16 -0
  164. package/build/markup/serialize.d.ts.map +1 -0
  165. package/build/markup/serialize.js +17 -0
  166. package/build/themes/index.d.ts +332 -333
  167. package/build/themes/index.d.ts.map +1 -1
  168. package/build/themes/index.js +1 -1
  169. package/build/translations.d.ts +66 -7
  170. package/build/translations.d.ts.map +1 -1
  171. package/build/translations.js +686 -629
  172. package/package.json +17 -26
  173. package/src/api/api-result.ts +10 -9
  174. package/src/api/contributed-to.ts +84 -0
  175. package/src/api/gist.ts +22 -46
  176. package/src/api/handler.ts +42 -0
  177. package/src/api/index.ts +13 -12
  178. package/src/api/params.ts +74 -29
  179. package/src/api/pin.ts +38 -65
  180. package/src/api/stats.ts +81 -118
  181. package/src/api/top-langs.ts +38 -80
  182. package/src/api/wakatime.ts +35 -73
  183. package/src/calculateRank.ts +12 -23
  184. package/src/cards/contributed-to.ts +373 -0
  185. package/src/cards/gist.ts +55 -49
  186. package/src/cards/options.ts +1 -1
  187. package/src/cards/repo.ts +134 -120
  188. package/src/cards/stats.ts +262 -252
  189. package/src/cards/top-languages.ts +315 -422
  190. package/src/cards/wakatime.ts +207 -225
  191. package/src/common/Card.ts +207 -214
  192. package/src/common/I18n.ts +7 -8
  193. package/src/common/brand.ts +109 -0
  194. package/src/common/color.ts +80 -57
  195. package/src/common/config.ts +5 -18
  196. package/src/common/constants.ts +8 -2
  197. package/src/common/date.ts +135 -5
  198. package/src/common/emojiMap.json +1915 -0
  199. package/src/common/emojiMap.ts +13 -0
  200. package/src/common/error.ts +2 -11
  201. package/src/common/fmt.ts +7 -44
  202. package/src/common/http.ts +9 -15
  203. package/src/common/icons.ts +122 -42
  204. package/src/common/languageColors.json +18 -2
  205. package/src/common/languageColors.ts +1 -4
  206. package/src/common/ops.ts +31 -48
  207. package/src/common/render.ts +334 -284
  208. package/src/common/retryer.ts +8 -15
  209. package/src/fetchers/contributed-to.ts +271 -0
  210. package/src/fetchers/gist.ts +8 -12
  211. package/src/fetchers/graphql-error.ts +36 -0
  212. package/src/fetchers/index.ts +15 -12
  213. package/src/fetchers/repo.ts +27 -40
  214. package/src/fetchers/stats.ts +157 -366
  215. package/src/fetchers/top-languages.ts +27 -55
  216. package/src/fetchers/types.ts +27 -1
  217. package/src/fetchers/wakatime.ts +5 -9
  218. package/src/graphql/contributionsCollection.ts +18 -0
  219. package/src/graphql/contributionsDocument.ts +14 -19
  220. package/src/graphql/generated/contributed-to.ts +25 -0
  221. package/src/graphql/generated/gist.ts +1 -1
  222. package/src/graphql/generated/repo.ts +1 -1
  223. package/src/graphql/generated/stats.ts +21 -8
  224. package/src/graphql/generated/top-languages.ts +2 -2
  225. package/src/graphql/graphqlDocument.ts +1 -2
  226. package/src/graphql/queries/contributed-to.graphql +8 -0
  227. package/src/graphql/queries/stats.graphql +14 -2
  228. package/src/graphql/reposContributedToDocument.ts +16 -15
  229. package/src/markup/css.ts +118 -0
  230. package/src/markup/element.ts +246 -0
  231. package/src/markup/html.ts +34 -0
  232. package/src/markup/index.ts +9 -0
  233. package/src/markup/serialize.ts +27 -0
  234. package/src/themes/index.ts +1 -1
  235. package/src/translations.ts +699 -629
  236. package/build/cards/index.d.ts +0 -11
  237. package/build/cards/index.d.ts.map +0 -1
  238. package/build/cards/index.js +0 -7
  239. package/build/common/html.d.ts +0 -8
  240. package/build/common/html.d.ts.map +0 -1
  241. package/build/common/html.js +0 -14
  242. package/build/index.d.ts +0 -15
  243. package/build/index.d.ts.map +0 -1
  244. package/build/index.js +0 -10
  245. package/src/_emoji-name-map.d.ts +0 -10
  246. package/src/_github-username-regex.d.ts +0 -4
  247. package/src/cards/index.ts +0 -21
  248. package/src/common/html.ts +0 -17
  249. package/src/index.ts +0 -18
@@ -1,21 +1,13 @@
1
- import { CardError, USER_NOT_FOUND } from '../common/error.js';
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
- logger.error(res.data.errors);
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
- allExcludedRepos.forEach((repoName) => {
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
- // flatten edges across repos. Order matters: `concat(acc)` prepends, and the
56
- // shared repoCount below depends on visitation order.
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
- return edges.length > 0 ? edges.concat(acc) : acc;
60
- }, []);
61
- // accumulate size and repo count per language
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: langSize,
79
- count: repoCount,
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 = Math.pow(lang.size, size_weight) * Math.pow(lang.count, count_weight);
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).sort(([, a], [, b]) => b.size - a.size));
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 { RepoInfoFragment } from '../graphql/generated/repo.js';
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,gBAAgB,EAAE,iBAAiB,CAAC,GAAG;IAC1D,eAAe,EAAE;QACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,GAAG,IAA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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.js';
2
- import type { WakaTimeData } from './types.js';
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;;;;;;;;;;GAUG;AACH,QAAA,MAAM,kBAAkB,GACtB,2BAGG;IACD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC,EACD,QAAQ,UAAU,KACjB,OAAO,CAAC,YAAY,CA2BtB,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
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.replace(/\/$/gi, '') : 'wakatime.com';
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 { YearContributionsFragment } from './generated/stats.js';
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<`year_${number}`, YearContributionsFragment> | null;
8
+ user: Record<`range_${number}`, RangeContributionsFragment> | null;
7
9
  }
8
10
  /**
9
- * Build the all-time contributions query, one aliased `contributionsCollection` field per year.
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: (years: Array<number>) => import("./graphqlDocument.js").GraphQLDocument<ContributionsQuery, ContributionsQueryVariables>;
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":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAGtE,UAAU,2BAA2B;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,yBAAyB,CAAC,GAAG,IAAI,CAAC;CAClE;AAED;;;;;;GAMG;AACH,QAAA,MAAM,0BAA0B,GAAI,OAAO,KAAK,CAAC,MAAM,CAAC,oGAoBvD,CAAC;AAEF,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
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 { getGitHubYearRange, toGitHubDateTime } from '../common/date.js';
1
+ import { aliasedRanges } from './contributionsCollection.js';
2
2
  import { graphqlDocument } from './graphqlDocument.js';
3
3
  /**
4
- * Build the all-time contributions query, one aliased `contributionsCollection` field per year.
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 = (years) => {
11
- const yearFields = years
12
- .map((year) => {
13
- const { from, to } = getGitHubYearRange(year);
14
- return `year_${year}: contributionsCollection(from: "${toGitHubDateTime(from)}", to: "${toGitHubDateTime(to)}") { ...YearContributions }`;
15
- })
16
- .join('\n');
17
- // fragment must match queries/stats.graphql, which generates its type
18
- return graphqlDocument(`
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
- ${yearFields}
13
+ ${aliasedRanges(ranges, 'RangeContributions')}
22
14
  }
23
15
  }
24
- fragment YearContributions on ContributionsCollection {
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.js").GraphQLDocument<GistInfoQuery, Exact<{
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.js").GraphQLDocument<GetRepoQuery, Exact<{
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.js';
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 YearContributionsFragment = {
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.js").GraphQLDocument<UserReposQuery, Exact<{
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.js").GraphQLDocument<UserInfoQuery, Exact<{
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;S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vC,CAAC,CAAC;IACH,uBAAuB,CAAC,EAAE;QACxB,KAAK,EAAE,KAAK,CAAC;YAAE,UAAU,EAAE;gBAAE,aAAa,EAAE,MAAM,CAAA;aAAE,CAAA;SAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;KACvE,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,iBAAiB;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.js';
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.js").GraphQLDocument<TopLanguagesQuery, Exact<{
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.js`.
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;;;;;GAKG;AACH,QAAA,MAAM,eAAe,GAAI,OAAO,EAAE,UAAU,EAC1C,MAAM,MAAM,KACX,eAAe,CAAC,OAAO,EAAE,UAAU,CAAe,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,eAAe,EAAE,CAAC"}
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,7 +1,6 @@
1
1
  /**
2
2
  * Build a typed document.
3
3
  *
4
- * @param text The query text, including every fragment it spreads.
5
4
  * @returns The document to pass to the function created by `createGraphQLFetcher`.
6
5
  */
7
6
  const graphqlDocument = (text) => ({ text });
@@ -1,5 +1,6 @@
1
- import type { GitHubDateRange } from '../common/date.js';
2
- import type { RangeContributionsByRepoFragment } from './generated/stats.js';
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) => import("./graphqlDocument.js").GraphQLDocument<ReposContributedToQuery, ReposContributedToQueryVariables>;
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;AAG7E,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;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,+BAA+B,GACnC,QAAQ,KAAK,CAAC,eAAe,CAAC,EAC9B,iBAAiB,OAAO,8GA+CzB,CAAC;AAEF,OAAO,EAAE,+BAA+B,EAAE,sBAAsB,EAAE,CAAC;AACnE,YAAY,EAAE,uBAAuB,EAAE,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 { toGitHubDateTime } from '../common/date.js';
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
- ${rangeFields}
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
  }`);