all-contributors-for-repository 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/collect/adding/addAcceptedIssues.d.ts +9 -0
- package/lib/collect/adding/addAcceptedIssues.js +27 -0
- package/lib/collect/adding/addAcceptedIssues.js.map +1 -0
- package/lib/collect/adding/addMergedPulls.d.ts +8 -0
- package/lib/collect/adding/addMergedPulls.js +22 -0
- package/lib/collect/adding/addMergedPulls.js.map +1 -0
- package/lib/collect/api.d.ts +1 -1
- package/lib/collect/api.js.map +1 -1
- package/lib/collect/collecting/collectAcceptedIssues.d.ts +511 -0
- package/lib/collect/{collectAcceptedIssues.js → collecting/collectAcceptedIssues.js} +4 -4
- package/lib/collect/collecting/collectAcceptedIssues.js.map +1 -0
- package/lib/collect/{collectIssueEvents.d.ts → collecting/collectIssueEvents.d.ts} +3 -2
- package/lib/collect/{collectIssueEvents.js → collecting/collectIssueEvents.js} +1 -1
- package/lib/collect/collecting/collectIssueEvents.js.map +1 -0
- package/lib/collect/{collectMergedPulls.d.ts → collecting/collectMergedPulls.d.ts} +3 -2
- package/lib/collect/{collectMergedPulls.js → collecting/collectMergedPulls.js} +1 -1
- package/lib/collect/collecting/collectMergedPulls.js.map +1 -0
- package/lib/collect/{collectEvents.d.ts → collecting/collectRepoEvents.d.ts} +4 -4
- package/lib/collect/collecting/collectRepoEvents.js +17 -0
- package/lib/collect/collecting/collectRepoEvents.js.map +1 -0
- package/lib/collect/index.js +13 -61
- package/lib/collect/index.js.map +1 -1
- package/lib/collect/processing/processContributors.d.ts +10 -0
- package/lib/collect/processing/processContributors.js +26 -0
- package/lib/collect/processing/processContributors.js.map +1 -0
- package/lib/collect/processing/repoEventIsPullRequestReviewEvent.d.ts +12 -0
- package/lib/collect/processing/repoEventIsPullRequestReviewEvent.js +7 -0
- package/lib/collect/processing/repoEventIsPullRequestReviewEvent.js.map +1 -0
- package/lib/options.d.ts +5 -0
- package/lib/options.js +2 -0
- package/lib/options.js.map +1 -1
- package/package.json +2 -2
- package/lib/collect/collectAcceptedIssues.d.ts +0 -512
- package/lib/collect/collectAcceptedIssues.js.map +0 -1
- package/lib/collect/collectEvents.js +0 -18
- package/lib/collect/collectEvents.js.map +0 -1
- package/lib/collect/collectIssueEvents.js.map +0 -1
- package/lib/collect/collectMergedPulls.js.map +0 -1
- package/lib/collect/eventIsPullRequestReviewEvent.d.ts +0 -12
- package/lib/collect/eventIsPullRequestReviewEvent.js +0 -7
- package/lib/collect/eventIsPullRequestReviewEvent.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ContributorsCollection } from '../../ContributorsCollection.js';
|
|
2
|
+
import { AllContributorsForRepositoryOptions } from '../../options.js';
|
|
3
|
+
import { AcceptedIssue } from '../collecting/collectAcceptedIssues.js';
|
|
4
|
+
import 'octokit';
|
|
5
|
+
import '../api.js';
|
|
6
|
+
|
|
7
|
+
declare function addAcceptedIssues(acceptedIssues: AcceptedIssue[], contributors: Pick<ContributorsCollection, "add">, options: Pick<AllContributorsForRepositoryOptions, `labelType${string}` & keyof AllContributorsForRepositoryOptions>): void;
|
|
8
|
+
|
|
9
|
+
export { addAcceptedIssues };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function addAcceptedIssues(acceptedIssues, contributors, options) {
|
|
2
|
+
for (const acceptedIssue of acceptedIssues) {
|
|
3
|
+
const labels = acceptedIssue.labels.map(
|
|
4
|
+
(label) => typeof label === "string" ? label : label.name
|
|
5
|
+
);
|
|
6
|
+
for (const [labelType, contribution] of [
|
|
7
|
+
// 🐛 `bug`: anybody who filed an issue labeled as accepting PRs and a bug
|
|
8
|
+
[options.labelTypeBug, "bug"],
|
|
9
|
+
// - 📖 `doc`: authors of merged PRs that address issues labeled as docs
|
|
10
|
+
[options.labelTypeDocs, "docs"],
|
|
11
|
+
// - 🔧 `tool`: authors of merged PRs that address issues labeled as tooling
|
|
12
|
+
[options.labelTypeTool, "tool"]
|
|
13
|
+
]) {
|
|
14
|
+
if (labels.some((label) => label === labelType)) {
|
|
15
|
+
contributors.add(
|
|
16
|
+
acceptedIssue.user?.login,
|
|
17
|
+
acceptedIssue.number,
|
|
18
|
+
contribution
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
addAcceptedIssues
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=addAcceptedIssues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/collect/adding/addAcceptedIssues.ts"],"sourcesContent":["import { ContributorsCollection } from \"../../ContributorsCollection.js\";\nimport { AllContributorsForRepositoryOptions } from \"../../options.js\";\nimport { AcceptedIssue } from \"../collecting/collectAcceptedIssues.js\";\n\nexport function addAcceptedIssues(\n\tacceptedIssues: AcceptedIssue[],\n\tcontributors: Pick<ContributorsCollection, \"add\">,\n\toptions: Pick<\n\t\tAllContributorsForRepositoryOptions,\n\t\t`labelType${string}` & keyof AllContributorsForRepositoryOptions\n\t>,\n) {\n\tfor (const acceptedIssue of acceptedIssues) {\n\t\tconst labels = acceptedIssue.labels.map((label) =>\n\t\t\ttypeof label === \"string\" ? label : label.name,\n\t\t);\n\n\t\tfor (const [labelType, contribution] of [\n\t\t\t// 🐛 `bug`: anybody who filed an issue labeled as accepting PRs and a bug\n\t\t\t[options.labelTypeBug, \"bug\"],\n\t\t\t// - 📖 `doc`: authors of merged PRs that address issues labeled as docs\n\t\t\t[options.labelTypeDocs, \"docs\"],\n\t\t\t// - 🔧 `tool`: authors of merged PRs that address issues labeled as tooling\n\t\t\t[options.labelTypeTool, \"tool\"],\n\t\t] as const) {\n\t\t\tif (labels.some((label) => label === labelType)) {\n\t\t\t\tcontributors.add(\n\t\t\t\t\tacceptedIssue.user?.login,\n\t\t\t\t\tacceptedIssue.number,\n\t\t\t\t\tcontribution,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n"],"mappings":"AAIO,SAAS,kBACf,gBACA,cACA,SAIC;AACD,aAAW,iBAAiB,gBAAgB;AAC3C,UAAM,SAAS,cAAc,OAAO;AAAA,MAAI,CAAC,UACxC,OAAO,UAAU,WAAW,QAAQ,MAAM;AAAA,IAC3C;AAEA,eAAW,CAAC,WAAW,YAAY,KAAK;AAAA;AAAA,MAEvC,CAAC,QAAQ,cAAc,KAAK;AAAA;AAAA,MAE5B,CAAC,QAAQ,eAAe,MAAM;AAAA;AAAA,MAE9B,CAAC,QAAQ,eAAe,MAAM;AAAA,IAC/B,GAAY;AACX,UAAI,OAAO,KAAK,CAAC,UAAU,UAAU,SAAS,GAAG;AAChD,qBAAa;AAAA,UACZ,cAAc,MAAM;AAAA,UACpB,cAAc;AAAA,UACd;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Octokit } from 'octokit';
|
|
2
|
+
import { ContributorsCollection } from '../../ContributorsCollection.js';
|
|
3
|
+
import { MergedPull } from '../collecting/collectMergedPulls.js';
|
|
4
|
+
import '../api.js';
|
|
5
|
+
|
|
6
|
+
declare function addMergedPulls(mergedPulls: MergedPull[], contributors: Pick<ContributorsCollection, "add">, octokit: Octokit): Promise<void>;
|
|
7
|
+
|
|
8
|
+
export { addMergedPulls };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createCachingCoAuthorToUsername } from "co-author-to-username";
|
|
2
|
+
import { parseMergedPullAuthors } from "../parsing/parseMergedPullAuthors.js";
|
|
3
|
+
import { parseMergedPullType } from "../parsing/parseMergedPullType.js";
|
|
4
|
+
async function addMergedPulls(mergedPulls, contributors, octokit) {
|
|
5
|
+
const cachingCoAuthorToUsername = createCachingCoAuthorToUsername({
|
|
6
|
+
fetcher: octokit
|
|
7
|
+
});
|
|
8
|
+
for (const mergedPull of mergedPulls) {
|
|
9
|
+
const authors = await parseMergedPullAuthors(
|
|
10
|
+
mergedPull,
|
|
11
|
+
cachingCoAuthorToUsername
|
|
12
|
+
);
|
|
13
|
+
const type = parseMergedPullType(mergedPull.title);
|
|
14
|
+
for (const author of authors) {
|
|
15
|
+
contributors.add(author, mergedPull.number, type);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
addMergedPulls
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=addMergedPulls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/collect/adding/addMergedPulls.ts"],"sourcesContent":["import { createCachingCoAuthorToUsername } from \"co-author-to-username\";\nimport { Octokit } from \"octokit\";\n\nimport { ContributorsCollection } from \"../../ContributorsCollection.js\";\nimport { MergedPull } from \"../collecting/collectMergedPulls.js\";\nimport { parseMergedPullAuthors } from \"../parsing/parseMergedPullAuthors.js\";\nimport { parseMergedPullType } from \"../parsing/parseMergedPullType.js\";\n\nexport async function addMergedPulls(\n\tmergedPulls: MergedPull[],\n\tcontributors: Pick<ContributorsCollection, \"add\">,\n\toctokit: Octokit,\n) {\n\tconst cachingCoAuthorToUsername = createCachingCoAuthorToUsername({\n\t\tfetcher: octokit,\n\t});\n\n\tfor (const mergedPull of mergedPulls) {\n\t\tconst authors = await parseMergedPullAuthors(\n\t\t\tmergedPull,\n\t\t\tcachingCoAuthorToUsername,\n\t\t);\n\t\tconst type = parseMergedPullType(mergedPull.title);\n\n\t\tfor (const author of authors) {\n\t\t\tcontributors.add(author, mergedPull.number, type);\n\t\t}\n\t}\n}\n"],"mappings":"AAAA,SAAS,uCAAuC;AAKhD,SAAS,8BAA8B;AACvC,SAAS,2BAA2B;AAEpC,eAAsB,eACrB,aACA,cACA,SACC;AACD,QAAM,4BAA4B,gCAAgC;AAAA,IACjE,SAAS;AAAA,EACV,CAAC;AAED,aAAW,cAAc,aAAa;AACrC,UAAM,UAAU,MAAM;AAAA,MACrB;AAAA,MACA;AAAA,IACD;AACA,UAAM,OAAO,oBAAoB,WAAW,KAAK;AAEjD,eAAW,UAAU,SAAS;AAC7B,mBAAa,IAAI,QAAQ,WAAW,QAAQ,IAAI;AAAA,IACjD;AAAA,EACD;AACD;","names":[]}
|
package/lib/collect/api.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ interface RequestOptionsWithPage extends RequestDefaults {
|
|
|
9
9
|
page: number;
|
|
10
10
|
per_page: number;
|
|
11
11
|
}
|
|
12
|
-
declare function paginate<T>(defaults: RequestDefaults, request: (
|
|
12
|
+
declare function paginate<T>(defaults: RequestDefaults, request: (requestOptions: RequestOptionsWithPage) => Promise<T[]>): Promise<T[]>;
|
|
13
13
|
|
|
14
14
|
export { type RequestDefaults, type RequestOptionsWithPage, createOctokit, paginate };
|
package/lib/collect/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collect/api.ts"],"sourcesContent":["import { Octokit } from \"octokit\";\n\nconst perPage = 100;\n\nexport interface RequestDefaults {\n\towner: string;\n\trepo: string;\n}\n\nexport function createOctokit(auth: string | undefined): Octokit {\n\treturn new (Octokit.defaults({\n\t\theaders: {\n\t\t\t\"X-GitHub-Api-Version\": \"2022-11-28\",\n\t\t},\n\t\tper_page: perPage,\n\t}))({ auth });\n}\n\nexport interface RequestOptionsWithPage extends RequestDefaults {\n\tpage: number;\n\tper_page: number;\n}\n\nexport async function paginate<T>(\n\tdefaults: RequestDefaults,\n\trequest: (
|
|
1
|
+
{"version":3,"sources":["../../src/collect/api.ts"],"sourcesContent":["import { Octokit } from \"octokit\";\n\nconst perPage = 100;\n\nexport interface RequestDefaults {\n\towner: string;\n\trepo: string;\n}\n\nexport function createOctokit(auth: string | undefined): Octokit {\n\treturn new (Octokit.defaults({\n\t\theaders: {\n\t\t\t\"X-GitHub-Api-Version\": \"2022-11-28\",\n\t\t},\n\t\tper_page: perPage,\n\t}))({ auth });\n}\n\nexport interface RequestOptionsWithPage extends RequestDefaults {\n\tpage: number;\n\tper_page: number;\n}\n\nexport async function paginate<T>(\n\tdefaults: RequestDefaults,\n\trequest: (requestOptions: RequestOptionsWithPage) => Promise<T[]>,\n) {\n\tconst items: T[] = [];\n\n\tfor (let i = 0; i < 10; i += 1) {\n\t\tconst response = await request({ page: i, per_page: perPage, ...defaults });\n\n\t\titems.push(...response);\n\n\t\tif (response.length < 100) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn items;\n}\n"],"mappings":"AAAA,SAAS,eAAe;AAExB,MAAM,UAAU;AAOT,SAAS,cAAc,MAAmC;AAChE,SAAO,KAAK,QAAQ,SAAS;AAAA,IAC5B,SAAS;AAAA,MACR,wBAAwB;AAAA,IACzB;AAAA,IACA,UAAU;AAAA,EACX,CAAC,GAAG,EAAE,KAAK,CAAC;AACb;AAOA,eAAsB,SACrB,UACA,SACC;AACD,QAAM,QAAa,CAAC;AAEpB,WAAS,IAAI,GAAG,IAAI,IAAI,KAAK,GAAG;AAC/B,UAAM,WAAW,MAAM,QAAQ,EAAE,MAAM,GAAG,UAAU,SAAS,GAAG,SAAS,CAAC;AAE1E,UAAM,KAAK,GAAG,QAAQ;AAEtB,QAAI,SAAS,SAAS,KAAK;AAC1B;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AACR;","names":[]}
|
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import { Octokit } from 'octokit';
|
|
2
|
+
import { RequestDefaults } from '../api.js';
|
|
3
|
+
|
|
4
|
+
type AcceptedIssue = Awaited<ReturnType<typeof collectAcceptedIssues>>[number];
|
|
5
|
+
declare function collectAcceptedIssues(defaults: RequestDefaults, octokit: Octokit, labelAcceptingPrs: string): Promise<{
|
|
6
|
+
id: number;
|
|
7
|
+
node_id: string;
|
|
8
|
+
url: string;
|
|
9
|
+
repository_url: string;
|
|
10
|
+
labels_url: string;
|
|
11
|
+
comments_url: string;
|
|
12
|
+
events_url: string;
|
|
13
|
+
html_url: string;
|
|
14
|
+
number: number;
|
|
15
|
+
state: string;
|
|
16
|
+
state_reason?: "completed" | "reopened" | "not_planned" | null | undefined;
|
|
17
|
+
title: string;
|
|
18
|
+
body?: string | null | undefined;
|
|
19
|
+
user: {
|
|
20
|
+
name?: string | null | undefined;
|
|
21
|
+
email?: string | null | undefined;
|
|
22
|
+
login: string;
|
|
23
|
+
id: number;
|
|
24
|
+
node_id: string;
|
|
25
|
+
avatar_url: string;
|
|
26
|
+
gravatar_id: string | null;
|
|
27
|
+
url: string;
|
|
28
|
+
html_url: string;
|
|
29
|
+
followers_url: string;
|
|
30
|
+
following_url: string;
|
|
31
|
+
gists_url: string;
|
|
32
|
+
starred_url: string;
|
|
33
|
+
subscriptions_url: string;
|
|
34
|
+
organizations_url: string;
|
|
35
|
+
repos_url: string;
|
|
36
|
+
events_url: string;
|
|
37
|
+
received_events_url: string;
|
|
38
|
+
type: string;
|
|
39
|
+
site_admin: boolean;
|
|
40
|
+
starred_at?: string | undefined;
|
|
41
|
+
} | null;
|
|
42
|
+
labels: (string | {
|
|
43
|
+
id?: number | undefined;
|
|
44
|
+
node_id?: string | undefined;
|
|
45
|
+
url?: string | undefined;
|
|
46
|
+
name?: string | undefined;
|
|
47
|
+
description?: string | null | undefined;
|
|
48
|
+
color?: string | null | undefined;
|
|
49
|
+
default?: boolean | undefined;
|
|
50
|
+
})[];
|
|
51
|
+
assignee: {
|
|
52
|
+
name?: string | null | undefined;
|
|
53
|
+
email?: string | null | undefined;
|
|
54
|
+
login: string;
|
|
55
|
+
id: number;
|
|
56
|
+
node_id: string;
|
|
57
|
+
avatar_url: string;
|
|
58
|
+
gravatar_id: string | null;
|
|
59
|
+
url: string;
|
|
60
|
+
html_url: string;
|
|
61
|
+
followers_url: string;
|
|
62
|
+
following_url: string;
|
|
63
|
+
gists_url: string;
|
|
64
|
+
starred_url: string;
|
|
65
|
+
subscriptions_url: string;
|
|
66
|
+
organizations_url: string;
|
|
67
|
+
repos_url: string;
|
|
68
|
+
events_url: string;
|
|
69
|
+
received_events_url: string;
|
|
70
|
+
type: string;
|
|
71
|
+
site_admin: boolean;
|
|
72
|
+
starred_at?: string | undefined;
|
|
73
|
+
} | null;
|
|
74
|
+
assignees?: {
|
|
75
|
+
name?: string | null | undefined;
|
|
76
|
+
email?: string | null | undefined;
|
|
77
|
+
login: string;
|
|
78
|
+
id: number;
|
|
79
|
+
node_id: string;
|
|
80
|
+
avatar_url: string;
|
|
81
|
+
gravatar_id: string | null;
|
|
82
|
+
url: string;
|
|
83
|
+
html_url: string;
|
|
84
|
+
followers_url: string;
|
|
85
|
+
following_url: string;
|
|
86
|
+
gists_url: string;
|
|
87
|
+
starred_url: string;
|
|
88
|
+
subscriptions_url: string;
|
|
89
|
+
organizations_url: string;
|
|
90
|
+
repos_url: string;
|
|
91
|
+
events_url: string;
|
|
92
|
+
received_events_url: string;
|
|
93
|
+
type: string;
|
|
94
|
+
site_admin: boolean;
|
|
95
|
+
starred_at?: string | undefined;
|
|
96
|
+
}[] | null | undefined;
|
|
97
|
+
milestone: {
|
|
98
|
+
url: string;
|
|
99
|
+
html_url: string;
|
|
100
|
+
labels_url: string;
|
|
101
|
+
id: number;
|
|
102
|
+
node_id: string;
|
|
103
|
+
number: number;
|
|
104
|
+
state: "open" | "closed";
|
|
105
|
+
title: string;
|
|
106
|
+
description: string | null;
|
|
107
|
+
creator: {
|
|
108
|
+
name?: string | null | undefined;
|
|
109
|
+
email?: string | null | undefined;
|
|
110
|
+
login: string;
|
|
111
|
+
id: number;
|
|
112
|
+
node_id: string;
|
|
113
|
+
avatar_url: string;
|
|
114
|
+
gravatar_id: string | null;
|
|
115
|
+
url: string;
|
|
116
|
+
html_url: string;
|
|
117
|
+
followers_url: string;
|
|
118
|
+
following_url: string;
|
|
119
|
+
gists_url: string;
|
|
120
|
+
starred_url: string;
|
|
121
|
+
subscriptions_url: string;
|
|
122
|
+
organizations_url: string;
|
|
123
|
+
repos_url: string;
|
|
124
|
+
events_url: string;
|
|
125
|
+
received_events_url: string;
|
|
126
|
+
type: string;
|
|
127
|
+
site_admin: boolean;
|
|
128
|
+
starred_at?: string | undefined;
|
|
129
|
+
} | null;
|
|
130
|
+
open_issues: number;
|
|
131
|
+
closed_issues: number;
|
|
132
|
+
created_at: string;
|
|
133
|
+
updated_at: string;
|
|
134
|
+
closed_at: string | null;
|
|
135
|
+
due_on: string | null;
|
|
136
|
+
} | null;
|
|
137
|
+
locked: boolean;
|
|
138
|
+
active_lock_reason?: string | null | undefined;
|
|
139
|
+
comments: number;
|
|
140
|
+
pull_request?: {
|
|
141
|
+
merged_at?: string | null | undefined;
|
|
142
|
+
diff_url: string | null;
|
|
143
|
+
html_url: string | null;
|
|
144
|
+
patch_url: string | null;
|
|
145
|
+
url: string | null;
|
|
146
|
+
} | undefined;
|
|
147
|
+
closed_at: string | null;
|
|
148
|
+
created_at: string;
|
|
149
|
+
updated_at: string;
|
|
150
|
+
draft?: boolean | undefined;
|
|
151
|
+
closed_by?: {
|
|
152
|
+
name?: string | null | undefined;
|
|
153
|
+
email?: string | null | undefined;
|
|
154
|
+
login: string;
|
|
155
|
+
id: number;
|
|
156
|
+
node_id: string;
|
|
157
|
+
avatar_url: string;
|
|
158
|
+
gravatar_id: string | null;
|
|
159
|
+
url: string;
|
|
160
|
+
html_url: string;
|
|
161
|
+
followers_url: string;
|
|
162
|
+
following_url: string;
|
|
163
|
+
gists_url: string;
|
|
164
|
+
starred_url: string;
|
|
165
|
+
subscriptions_url: string;
|
|
166
|
+
organizations_url: string;
|
|
167
|
+
repos_url: string;
|
|
168
|
+
events_url: string;
|
|
169
|
+
received_events_url: string;
|
|
170
|
+
type: string;
|
|
171
|
+
site_admin: boolean;
|
|
172
|
+
starred_at?: string | undefined;
|
|
173
|
+
} | null | undefined;
|
|
174
|
+
body_html?: string | undefined;
|
|
175
|
+
body_text?: string | undefined;
|
|
176
|
+
timeline_url?: string | undefined;
|
|
177
|
+
repository?: {
|
|
178
|
+
id: number;
|
|
179
|
+
node_id: string;
|
|
180
|
+
name: string;
|
|
181
|
+
full_name: string;
|
|
182
|
+
license: {
|
|
183
|
+
key: string;
|
|
184
|
+
name: string;
|
|
185
|
+
url: string | null;
|
|
186
|
+
spdx_id: string | null;
|
|
187
|
+
node_id: string;
|
|
188
|
+
html_url?: string | undefined;
|
|
189
|
+
} | null;
|
|
190
|
+
organization?: {
|
|
191
|
+
name?: string | null | undefined;
|
|
192
|
+
email?: string | null | undefined;
|
|
193
|
+
login: string;
|
|
194
|
+
id: number;
|
|
195
|
+
node_id: string;
|
|
196
|
+
avatar_url: string;
|
|
197
|
+
gravatar_id: string | null;
|
|
198
|
+
url: string;
|
|
199
|
+
html_url: string;
|
|
200
|
+
followers_url: string;
|
|
201
|
+
following_url: string;
|
|
202
|
+
gists_url: string;
|
|
203
|
+
starred_url: string;
|
|
204
|
+
subscriptions_url: string;
|
|
205
|
+
organizations_url: string;
|
|
206
|
+
repos_url: string;
|
|
207
|
+
events_url: string;
|
|
208
|
+
received_events_url: string;
|
|
209
|
+
type: string;
|
|
210
|
+
site_admin: boolean;
|
|
211
|
+
starred_at?: string | undefined;
|
|
212
|
+
} | null | undefined;
|
|
213
|
+
forks: number;
|
|
214
|
+
permissions?: {
|
|
215
|
+
admin: boolean;
|
|
216
|
+
pull: boolean;
|
|
217
|
+
triage?: boolean | undefined;
|
|
218
|
+
push: boolean;
|
|
219
|
+
maintain?: boolean | undefined;
|
|
220
|
+
} | undefined;
|
|
221
|
+
owner: {
|
|
222
|
+
name?: string | null | undefined;
|
|
223
|
+
email?: string | null | undefined;
|
|
224
|
+
login: string;
|
|
225
|
+
id: number;
|
|
226
|
+
node_id: string;
|
|
227
|
+
avatar_url: string;
|
|
228
|
+
gravatar_id: string | null;
|
|
229
|
+
url: string;
|
|
230
|
+
html_url: string;
|
|
231
|
+
followers_url: string;
|
|
232
|
+
following_url: string;
|
|
233
|
+
gists_url: string;
|
|
234
|
+
starred_url: string;
|
|
235
|
+
subscriptions_url: string;
|
|
236
|
+
organizations_url: string;
|
|
237
|
+
repos_url: string;
|
|
238
|
+
events_url: string;
|
|
239
|
+
received_events_url: string;
|
|
240
|
+
type: string;
|
|
241
|
+
site_admin: boolean;
|
|
242
|
+
starred_at?: string | undefined;
|
|
243
|
+
};
|
|
244
|
+
private: boolean;
|
|
245
|
+
html_url: string;
|
|
246
|
+
description: string | null;
|
|
247
|
+
fork: boolean;
|
|
248
|
+
url: string;
|
|
249
|
+
archive_url: string;
|
|
250
|
+
assignees_url: string;
|
|
251
|
+
blobs_url: string;
|
|
252
|
+
branches_url: string;
|
|
253
|
+
collaborators_url: string;
|
|
254
|
+
comments_url: string;
|
|
255
|
+
commits_url: string;
|
|
256
|
+
compare_url: string;
|
|
257
|
+
contents_url: string;
|
|
258
|
+
contributors_url: string;
|
|
259
|
+
deployments_url: string;
|
|
260
|
+
downloads_url: string;
|
|
261
|
+
events_url: string;
|
|
262
|
+
forks_url: string;
|
|
263
|
+
git_commits_url: string;
|
|
264
|
+
git_refs_url: string;
|
|
265
|
+
git_tags_url: string;
|
|
266
|
+
git_url: string;
|
|
267
|
+
issue_comment_url: string;
|
|
268
|
+
issue_events_url: string;
|
|
269
|
+
issues_url: string;
|
|
270
|
+
keys_url: string;
|
|
271
|
+
labels_url: string;
|
|
272
|
+
languages_url: string;
|
|
273
|
+
merges_url: string;
|
|
274
|
+
milestones_url: string;
|
|
275
|
+
notifications_url: string;
|
|
276
|
+
pulls_url: string;
|
|
277
|
+
releases_url: string;
|
|
278
|
+
ssh_url: string;
|
|
279
|
+
stargazers_url: string;
|
|
280
|
+
statuses_url: string;
|
|
281
|
+
subscribers_url: string;
|
|
282
|
+
subscription_url: string;
|
|
283
|
+
tags_url: string;
|
|
284
|
+
teams_url: string;
|
|
285
|
+
trees_url: string;
|
|
286
|
+
clone_url: string;
|
|
287
|
+
mirror_url: string | null;
|
|
288
|
+
hooks_url: string;
|
|
289
|
+
svn_url: string;
|
|
290
|
+
homepage: string | null;
|
|
291
|
+
language: string | null;
|
|
292
|
+
forks_count: number;
|
|
293
|
+
stargazers_count: number;
|
|
294
|
+
watchers_count: number;
|
|
295
|
+
size: number;
|
|
296
|
+
default_branch: string;
|
|
297
|
+
open_issues_count: number;
|
|
298
|
+
is_template?: boolean | undefined;
|
|
299
|
+
topics?: string[] | undefined;
|
|
300
|
+
has_issues: boolean;
|
|
301
|
+
has_projects: boolean;
|
|
302
|
+
has_wiki: boolean;
|
|
303
|
+
has_pages: boolean;
|
|
304
|
+
has_downloads: boolean;
|
|
305
|
+
has_discussions?: boolean | undefined;
|
|
306
|
+
archived: boolean;
|
|
307
|
+
disabled: boolean;
|
|
308
|
+
visibility?: string | undefined;
|
|
309
|
+
pushed_at: string | null;
|
|
310
|
+
created_at: string | null;
|
|
311
|
+
updated_at: string | null;
|
|
312
|
+
allow_rebase_merge?: boolean | undefined;
|
|
313
|
+
template_repository?: {
|
|
314
|
+
id?: number | undefined;
|
|
315
|
+
node_id?: string | undefined;
|
|
316
|
+
name?: string | undefined;
|
|
317
|
+
full_name?: string | undefined;
|
|
318
|
+
owner?: {
|
|
319
|
+
login?: string | undefined;
|
|
320
|
+
id?: number | undefined;
|
|
321
|
+
node_id?: string | undefined;
|
|
322
|
+
avatar_url?: string | undefined;
|
|
323
|
+
gravatar_id?: string | undefined;
|
|
324
|
+
url?: string | undefined;
|
|
325
|
+
html_url?: string | undefined;
|
|
326
|
+
followers_url?: string | undefined;
|
|
327
|
+
following_url?: string | undefined;
|
|
328
|
+
gists_url?: string | undefined;
|
|
329
|
+
starred_url?: string | undefined;
|
|
330
|
+
subscriptions_url?: string | undefined;
|
|
331
|
+
organizations_url?: string | undefined;
|
|
332
|
+
repos_url?: string | undefined;
|
|
333
|
+
events_url?: string | undefined;
|
|
334
|
+
received_events_url?: string | undefined;
|
|
335
|
+
type?: string | undefined;
|
|
336
|
+
site_admin?: boolean | undefined;
|
|
337
|
+
} | undefined;
|
|
338
|
+
private?: boolean | undefined;
|
|
339
|
+
html_url?: string | undefined;
|
|
340
|
+
description?: string | undefined;
|
|
341
|
+
fork?: boolean | undefined;
|
|
342
|
+
url?: string | undefined;
|
|
343
|
+
archive_url?: string | undefined;
|
|
344
|
+
assignees_url?: string | undefined;
|
|
345
|
+
blobs_url?: string | undefined;
|
|
346
|
+
branches_url?: string | undefined;
|
|
347
|
+
collaborators_url?: string | undefined;
|
|
348
|
+
comments_url?: string | undefined;
|
|
349
|
+
commits_url?: string | undefined;
|
|
350
|
+
compare_url?: string | undefined;
|
|
351
|
+
contents_url?: string | undefined;
|
|
352
|
+
contributors_url?: string | undefined;
|
|
353
|
+
deployments_url?: string | undefined;
|
|
354
|
+
downloads_url?: string | undefined;
|
|
355
|
+
events_url?: string | undefined;
|
|
356
|
+
forks_url?: string | undefined;
|
|
357
|
+
git_commits_url?: string | undefined;
|
|
358
|
+
git_refs_url?: string | undefined;
|
|
359
|
+
git_tags_url?: string | undefined;
|
|
360
|
+
git_url?: string | undefined;
|
|
361
|
+
issue_comment_url?: string | undefined;
|
|
362
|
+
issue_events_url?: string | undefined;
|
|
363
|
+
issues_url?: string | undefined;
|
|
364
|
+
keys_url?: string | undefined;
|
|
365
|
+
labels_url?: string | undefined;
|
|
366
|
+
languages_url?: string | undefined;
|
|
367
|
+
merges_url?: string | undefined;
|
|
368
|
+
milestones_url?: string | undefined;
|
|
369
|
+
notifications_url?: string | undefined;
|
|
370
|
+
pulls_url?: string | undefined;
|
|
371
|
+
releases_url?: string | undefined;
|
|
372
|
+
ssh_url?: string | undefined;
|
|
373
|
+
stargazers_url?: string | undefined;
|
|
374
|
+
statuses_url?: string | undefined;
|
|
375
|
+
subscribers_url?: string | undefined;
|
|
376
|
+
subscription_url?: string | undefined;
|
|
377
|
+
tags_url?: string | undefined;
|
|
378
|
+
teams_url?: string | undefined;
|
|
379
|
+
trees_url?: string | undefined;
|
|
380
|
+
clone_url?: string | undefined;
|
|
381
|
+
mirror_url?: string | undefined;
|
|
382
|
+
hooks_url?: string | undefined;
|
|
383
|
+
svn_url?: string | undefined;
|
|
384
|
+
homepage?: string | undefined;
|
|
385
|
+
language?: string | undefined;
|
|
386
|
+
forks_count?: number | undefined;
|
|
387
|
+
stargazers_count?: number | undefined;
|
|
388
|
+
watchers_count?: number | undefined;
|
|
389
|
+
size?: number | undefined;
|
|
390
|
+
default_branch?: string | undefined;
|
|
391
|
+
open_issues_count?: number | undefined;
|
|
392
|
+
is_template?: boolean | undefined;
|
|
393
|
+
topics?: string[] | undefined;
|
|
394
|
+
has_issues?: boolean | undefined;
|
|
395
|
+
has_projects?: boolean | undefined;
|
|
396
|
+
has_wiki?: boolean | undefined;
|
|
397
|
+
has_pages?: boolean | undefined;
|
|
398
|
+
has_downloads?: boolean | undefined;
|
|
399
|
+
archived?: boolean | undefined;
|
|
400
|
+
disabled?: boolean | undefined;
|
|
401
|
+
visibility?: string | undefined;
|
|
402
|
+
pushed_at?: string | undefined;
|
|
403
|
+
created_at?: string | undefined;
|
|
404
|
+
updated_at?: string | undefined;
|
|
405
|
+
permissions?: {
|
|
406
|
+
admin?: boolean | undefined;
|
|
407
|
+
maintain?: boolean | undefined;
|
|
408
|
+
push?: boolean | undefined;
|
|
409
|
+
triage?: boolean | undefined;
|
|
410
|
+
pull?: boolean | undefined;
|
|
411
|
+
} | undefined;
|
|
412
|
+
allow_rebase_merge?: boolean | undefined;
|
|
413
|
+
temp_clone_token?: string | undefined;
|
|
414
|
+
allow_squash_merge?: boolean | undefined;
|
|
415
|
+
allow_auto_merge?: boolean | undefined;
|
|
416
|
+
delete_branch_on_merge?: boolean | undefined;
|
|
417
|
+
allow_update_branch?: boolean | undefined;
|
|
418
|
+
use_squash_pr_title_as_default?: boolean | undefined;
|
|
419
|
+
squash_merge_commit_title?: "PR_TITLE" | "COMMIT_OR_PR_TITLE" | undefined;
|
|
420
|
+
squash_merge_commit_message?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK" | undefined;
|
|
421
|
+
merge_commit_title?: "PR_TITLE" | "MERGE_MESSAGE" | undefined;
|
|
422
|
+
merge_commit_message?: "PR_TITLE" | "PR_BODY" | "BLANK" | undefined;
|
|
423
|
+
allow_merge_commit?: boolean | undefined;
|
|
424
|
+
subscribers_count?: number | undefined;
|
|
425
|
+
network_count?: number | undefined;
|
|
426
|
+
} | null | undefined;
|
|
427
|
+
temp_clone_token?: string | undefined;
|
|
428
|
+
allow_squash_merge?: boolean | undefined;
|
|
429
|
+
allow_auto_merge?: boolean | undefined;
|
|
430
|
+
delete_branch_on_merge?: boolean | undefined;
|
|
431
|
+
allow_update_branch?: boolean | undefined;
|
|
432
|
+
use_squash_pr_title_as_default?: boolean | undefined;
|
|
433
|
+
squash_merge_commit_title?: "PR_TITLE" | "COMMIT_OR_PR_TITLE" | undefined;
|
|
434
|
+
squash_merge_commit_message?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK" | undefined;
|
|
435
|
+
merge_commit_title?: "PR_TITLE" | "MERGE_MESSAGE" | undefined;
|
|
436
|
+
merge_commit_message?: "PR_TITLE" | "PR_BODY" | "BLANK" | undefined;
|
|
437
|
+
allow_merge_commit?: boolean | undefined;
|
|
438
|
+
allow_forking?: boolean | undefined;
|
|
439
|
+
web_commit_signoff_required?: boolean | undefined;
|
|
440
|
+
subscribers_count?: number | undefined;
|
|
441
|
+
network_count?: number | undefined;
|
|
442
|
+
open_issues: number;
|
|
443
|
+
watchers: number;
|
|
444
|
+
master_branch?: string | undefined;
|
|
445
|
+
starred_at?: string | undefined;
|
|
446
|
+
anonymous_access_enabled?: boolean | undefined;
|
|
447
|
+
} | undefined;
|
|
448
|
+
performed_via_github_app?: {
|
|
449
|
+
id: number;
|
|
450
|
+
slug?: string | undefined;
|
|
451
|
+
node_id: string;
|
|
452
|
+
owner: {
|
|
453
|
+
name?: string | null | undefined;
|
|
454
|
+
email?: string | null | undefined;
|
|
455
|
+
login: string;
|
|
456
|
+
id: number;
|
|
457
|
+
node_id: string;
|
|
458
|
+
avatar_url: string;
|
|
459
|
+
gravatar_id: string | null;
|
|
460
|
+
url: string;
|
|
461
|
+
html_url: string;
|
|
462
|
+
followers_url: string;
|
|
463
|
+
following_url: string;
|
|
464
|
+
gists_url: string;
|
|
465
|
+
starred_url: string;
|
|
466
|
+
subscriptions_url: string;
|
|
467
|
+
organizations_url: string;
|
|
468
|
+
repos_url: string;
|
|
469
|
+
events_url: string;
|
|
470
|
+
received_events_url: string;
|
|
471
|
+
type: string;
|
|
472
|
+
site_admin: boolean;
|
|
473
|
+
starred_at?: string | undefined;
|
|
474
|
+
} | null;
|
|
475
|
+
name: string;
|
|
476
|
+
description: string | null;
|
|
477
|
+
external_url: string;
|
|
478
|
+
html_url: string;
|
|
479
|
+
created_at: string;
|
|
480
|
+
updated_at: string;
|
|
481
|
+
permissions: {
|
|
482
|
+
[key: string]: string | undefined;
|
|
483
|
+
issues?: string | undefined;
|
|
484
|
+
checks?: string | undefined;
|
|
485
|
+
metadata?: string | undefined;
|
|
486
|
+
contents?: string | undefined;
|
|
487
|
+
deployments?: string | undefined;
|
|
488
|
+
};
|
|
489
|
+
events: string[];
|
|
490
|
+
installations_count?: number | undefined;
|
|
491
|
+
client_id?: string | undefined;
|
|
492
|
+
client_secret?: string | undefined;
|
|
493
|
+
webhook_secret?: string | null | undefined;
|
|
494
|
+
pem?: string | undefined;
|
|
495
|
+
} | null | undefined;
|
|
496
|
+
author_association: "COLLABORATOR" | "CONTRIBUTOR" | "FIRST_TIMER" | "FIRST_TIME_CONTRIBUTOR" | "MANNEQUIN" | "MEMBER" | "NONE" | "OWNER";
|
|
497
|
+
reactions?: {
|
|
498
|
+
url: string;
|
|
499
|
+
total_count: number;
|
|
500
|
+
"+1": number;
|
|
501
|
+
"-1": number;
|
|
502
|
+
laugh: number;
|
|
503
|
+
confused: number;
|
|
504
|
+
heart: number;
|
|
505
|
+
hooray: number;
|
|
506
|
+
eyes: number;
|
|
507
|
+
rocket: number;
|
|
508
|
+
} | undefined;
|
|
509
|
+
}[]>;
|
|
510
|
+
|
|
511
|
+
export { type AcceptedIssue, collectAcceptedIssues };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { paginate } from "
|
|
1
|
+
import { paginate } from "../api.js";
|
|
2
2
|
async function collectAcceptedIssues(defaults, octokit, labelAcceptingPrs) {
|
|
3
|
-
const issues = await paginate(defaults, async (
|
|
3
|
+
const issues = await paginate(defaults, async (requestOptions) => {
|
|
4
4
|
const response = await octokit.request("GET /repos/{owner}/{repo}/issues", {
|
|
5
|
-
...
|
|
5
|
+
...requestOptions,
|
|
6
6
|
labels: labelAcceptingPrs,
|
|
7
7
|
state: "all"
|
|
8
8
|
});
|
|
9
9
|
return response.data;
|
|
10
10
|
});
|
|
11
|
-
return
|
|
11
|
+
return issues;
|
|
12
12
|
}
|
|
13
13
|
export {
|
|
14
14
|
collectAcceptedIssues
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/collect/collecting/collectAcceptedIssues.ts"],"sourcesContent":["import { Octokit } from \"octokit\";\n\nimport { RequestDefaults, paginate } from \"../api.js\";\n\nexport type AcceptedIssue = Awaited<\n\tReturnType<typeof collectAcceptedIssues>\n>[number];\n\nexport async function collectAcceptedIssues(\n\tdefaults: RequestDefaults,\n\toctokit: Octokit,\n\tlabelAcceptingPrs: string,\n) {\n\tconst issues = await paginate(defaults, async (requestOptions) => {\n\t\tconst response = await octokit.request(\"GET /repos/{owner}/{repo}/issues\", {\n\t\t\t...requestOptions,\n\t\t\tlabels: labelAcceptingPrs,\n\t\t\tstate: \"all\",\n\t\t});\n\t\treturn response.data;\n\t});\n\n\treturn issues;\n}\n"],"mappings":"AAEA,SAA0B,gBAAgB;AAM1C,eAAsB,sBACrB,UACA,SACA,mBACC;AACD,QAAM,SAAS,MAAM,SAAS,UAAU,OAAO,mBAAmB;AACjE,UAAM,WAAW,MAAM,QAAQ,QAAQ,oCAAoC;AAAA,MAC1E,GAAG;AAAA,MACH,QAAQ;AAAA,MACR,OAAO;AAAA,IACR,CAAC;AACD,WAAO,SAAS;AAAA,EACjB,CAAC;AAED,SAAO;AACR;","names":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Octokit } from 'octokit';
|
|
2
|
-
import { RequestDefaults } from '
|
|
2
|
+
import { RequestDefaults } from '../api.js';
|
|
3
3
|
|
|
4
|
+
type IssueEvent = Awaited<ReturnType<typeof collectIssueEvents>>[number];
|
|
4
5
|
declare function collectIssueEvents(defaults: RequestDefaults, octokit: Octokit): Promise<{
|
|
5
6
|
id: number;
|
|
6
7
|
node_id: string;
|
|
@@ -742,4 +743,4 @@ declare function collectIssueEvents(defaults: RequestDefaults, octokit: Octokit)
|
|
|
742
743
|
} | null | undefined;
|
|
743
744
|
}[]>;
|
|
744
745
|
|
|
745
|
-
export { collectIssueEvents };
|
|
746
|
+
export { type IssueEvent, collectIssueEvents };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/collect/collecting/collectIssueEvents.ts"],"sourcesContent":["import { Octokit } from \"octokit\";\n\nimport { RequestDefaults, paginate } from \"../api.js\";\n\nconst relevantIssueEvents = new Set([\n\t\"assigned\",\n\t\"locked\",\n\t\"merged\",\n\t\"pinned\",\n\t\"unlocked\",\n]);\n\nexport type IssueEvent = Awaited<ReturnType<typeof collectIssueEvents>>[number];\n\nexport async function collectIssueEvents(\n\tdefaults: RequestDefaults,\n\toctokit: Octokit,\n) {\n\tconst issueEvents = await paginate(defaults, async (options) => {\n\t\tconst response = await octokit.request(\n\t\t\t\"GET /repos/{owner}/{repo}/issues/events\",\n\t\t\t{\n\t\t\t\t...options,\n\t\t\t\tstate: \"all\",\n\t\t\t},\n\t\t);\n\t\treturn response.data;\n\t});\n\n\treturn issueEvents.filter((issueEvent) =>\n\t\trelevantIssueEvents.has(issueEvent.event),\n\t);\n}\n"],"mappings":"AAEA,SAA0B,gBAAgB;AAE1C,MAAM,sBAAsB,oBAAI,IAAI;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AAID,eAAsB,mBACrB,UACA,SACC;AACD,QAAM,cAAc,MAAM,SAAS,UAAU,OAAO,YAAY;AAC/D,UAAM,WAAW,MAAM,QAAQ;AAAA,MAC9B;AAAA,MACA;AAAA,QACC,GAAG;AAAA,QACH,OAAO;AAAA,MACR;AAAA,IACD;AACA,WAAO,SAAS;AAAA,EACjB,CAAC;AAED,SAAO,YAAY;AAAA,IAAO,CAAC,eAC1B,oBAAoB,IAAI,WAAW,KAAK;AAAA,EACzC;AACD;","names":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Octokit } from 'octokit';
|
|
2
|
-
import { RequestDefaults } from '
|
|
2
|
+
import { RequestDefaults } from '../api.js';
|
|
3
3
|
|
|
4
|
+
type MergedPull = Awaited<ReturnType<typeof collectMergedPulls>>[number];
|
|
4
5
|
declare function collectMergedPulls(defaults: RequestDefaults, octokit: Octokit): Promise<{
|
|
5
6
|
url: string;
|
|
6
7
|
repository_url: string;
|
|
@@ -495,4 +496,4 @@ declare function collectMergedPulls(defaults: RequestDefaults, octokit: Octokit)
|
|
|
495
496
|
} | undefined;
|
|
496
497
|
}[]>;
|
|
497
498
|
|
|
498
|
-
export { collectMergedPulls };
|
|
499
|
+
export { type MergedPull, collectMergedPulls };
|