all-contributors-for-repository 0.7.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -5
- package/lib/collect/adding/addMergedPulls.d.ts +1 -2
- package/lib/collect/adding/addMergedPulls.d.ts.map +1 -1
- package/lib/collect/adding/addMergedPulls.js +3 -12
- package/lib/collect/adding/addMergedPulls.js.map +1 -1
- package/lib/collect/index.js +2 -2
- package/lib/collect/index.js.map +1 -1
- package/lib/options.d.ts +0 -5
- package/lib/options.d.ts.map +1 -1
- package/lib/options.js +2 -4
- package/lib/options.js.map +1 -1
- package/package.json +1 -1
- package/lib/collect/collecting/collectPullFiles.d.ts +0 -18
- package/lib/collect/collecting/collectPullFiles.d.ts.map +0 -1
- package/lib/collect/collecting/collectPullFiles.js +0 -13
- package/lib/collect/collecting/collectPullFiles.js.map +0 -1
package/README.md
CHANGED
|
@@ -51,7 +51,6 @@ The types of contributions detected from the GitHub API are:
|
|
|
51
51
|
- 📖 `doc`: authors of merged PRs that address issues labeled as accepting PRs and docs _(see [Options](#options))_
|
|
52
52
|
- 🚧 `maintenance`: adding labels to issues and PRs, and merging PRs
|
|
53
53
|
- 👀 `review`: submitting a review for a PR
|
|
54
|
-
- ⚠️ `test`: authors of merged PRs that touch test files _(see [Options](#options))_
|
|
55
54
|
- 🔧 `tool`: authors of merged PRs that address issues labeled as accepting PRs and tooling _(see [Options](#options))_
|
|
56
55
|
|
|
57
56
|
Additionally, based on PR [conventional commit titles](https://www.conventionalcommits.org/en/v1.0.0/#summary) in the [Angular convention](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type), for all PR authors and co-authors:
|
|
@@ -95,9 +94,6 @@ It additionally allows for the following optional options.
|
|
|
95
94
|
- `since` _(`Date`)_: Only include contributions made at or after this time.
|
|
96
95
|
- Default: no limit; all available contributions are included.
|
|
97
96
|
- Useful for repeated runs, to avoid re-requesting contributions that were already seen.
|
|
98
|
-
- `testFiles` _(`RegExp[]`)_: Regular expressions for file paths that count as tests, for merged PRs to be given a `test` contribution.
|
|
99
|
-
- Default: `[/\.(spec|test)\.[^/]+$/i, /(^|\/)(__tests__|tests?)\//i]`
|
|
100
|
-
- Pass `[]` to skip looking at PR files altogether.
|
|
101
97
|
|
|
102
98
|
```ts
|
|
103
99
|
import { getAllContributorsForRepository } from "all-contributors-for-repository";
|
|
@@ -111,7 +107,6 @@ getAllContributorsForRepository({
|
|
|
111
107
|
labelTypeIdeas: "feature",
|
|
112
108
|
labelTypeTool: "tool",
|
|
113
109
|
since: new Date("2026-01-01"),
|
|
114
|
-
testFiles: [/^tests\//],
|
|
115
110
|
});
|
|
116
111
|
```
|
|
117
112
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ContributorsCollection } from "../../ContributorsCollection.js";
|
|
2
|
-
import { AllContributorsForRepositoryOptions } from "../../options.js";
|
|
3
2
|
import { MergedPull } from "../collecting/collectMergedPulls.js";
|
|
4
3
|
import { Octokit } from "octokit";
|
|
5
4
|
//#region src/collect/adding/addMergedPulls.d.ts
|
|
6
|
-
export declare function addMergedPulls(mergedPulls: MergedPull[], contributors: Pick<ContributorsCollection, "add">, octokit: Octokit
|
|
5
|
+
export declare function addMergedPulls(mergedPulls: MergedPull[], contributors: Pick<ContributorsCollection, "add">, octokit: Octokit): Promise<void>;
|
|
7
6
|
//#endregion
|
|
8
7
|
//# sourceMappingURL=addMergedPulls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addMergedPulls.d.ts","names":[],"sources":["../../../src/collect/adding/addMergedPulls.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"addMergedPulls.d.ts","names":[],"sources":["../../../src/collect/adding/addMergedPulls.ts"],"mappings":";;;;wBAQsB,eACrB,aAAa,cACb,cAAc,KAAK,gCACnB,SAAS,UAAO"}
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import { collectPullFiles } from "../collecting/collectPullFiles.js";
|
|
2
1
|
import { parseMergedPullAuthors } from "../parsing/parseMergedPullAuthors.js";
|
|
3
2
|
import { parseMergedPullType } from "../parsing/parseMergedPullType.js";
|
|
4
3
|
import { createCachingCoAuthorToUsername } from "co-author-to-username";
|
|
5
4
|
//#region src/collect/adding/addMergedPulls.ts
|
|
6
|
-
async function addMergedPulls(mergedPulls, contributors, octokit
|
|
5
|
+
async function addMergedPulls(mergedPulls, contributors, octokit) {
|
|
7
6
|
const cachingCoAuthorToUsername = createCachingCoAuthorToUsername({ fetcher: octokit });
|
|
8
|
-
const defaults = {
|
|
9
|
-
owner: options.owner,
|
|
10
|
-
repo: options.repo
|
|
11
|
-
};
|
|
12
7
|
for (const mergedPull of mergedPulls) {
|
|
13
8
|
const authors = await parseMergedPullAuthors(mergedPull, cachingCoAuthorToUsername);
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
for (const author of authors) for (const type of types) contributors.add(author, mergedPull.number, type);
|
|
17
|
-
}
|
|
18
|
-
async function touchesTestFiles(pullNumber) {
|
|
19
|
-
return (await collectPullFiles(defaults, octokit, pullNumber)).some((file) => options.testFiles.some((pattern) => pattern.test(file.filename)));
|
|
9
|
+
const type = parseMergedPullType(mergedPull.title);
|
|
10
|
+
for (const author of authors) contributors.add(author, mergedPull.number, type);
|
|
20
11
|
}
|
|
21
12
|
}
|
|
22
13
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addMergedPulls.js","names":[],"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 {
|
|
1
|
+
{"version":3,"file":"addMergedPulls.js","names":[],"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":";;;;AAQA,eAAsB,eACrB,aACA,cACA,SACC;CACD,MAAM,4BAA4B,gCAAgC,EACjE,SAAS,QACV,CAAC;CAED,KAAK,MAAM,cAAc,aAAa;EACrC,MAAM,UAAU,MAAM,uBACrB,YACA,yBACD;EACA,MAAM,OAAO,oBAAoB,WAAW,KAAK;EAEjD,KAAK,MAAM,UAAU,SACpB,aAAa,IAAI,QAAQ,WAAW,QAAQ,IAAI;CAElD;AACD"}
|
package/lib/collect/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { addAcceptedIssues } from "./adding/addAcceptedIssues.js";
|
|
2
|
-
import { createOctokit } from "./api.js";
|
|
3
2
|
import { addMergedPulls } from "./adding/addMergedPulls.js";
|
|
3
|
+
import { createOctokit } from "./api.js";
|
|
4
4
|
import { collectAcceptedIssues } from "./collecting/collectAcceptedIssues.js";
|
|
5
5
|
import { collectIssueEvents } from "./collecting/collectIssueEvents.js";
|
|
6
6
|
import { collectMergedPulls } from "./collecting/collectMergedPulls.js";
|
|
@@ -21,7 +21,7 @@ async function collect(options) {
|
|
|
21
21
|
]);
|
|
22
22
|
const contributors = processContributors(issueEvents, repoEvents, options);
|
|
23
23
|
addAcceptedIssues(Object.values(acceptedIssues), contributors, options);
|
|
24
|
-
await addMergedPulls(mergedPulls, contributors, octokit
|
|
24
|
+
await addMergedPulls(mergedPulls, contributors, octokit);
|
|
25
25
|
return contributors.collect();
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
package/lib/collect/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/collect/index.ts"],"sourcesContent":["import { ContributorsContributions } from \"../ContributorsCollection.js\";\nimport { AllContributorsForRepositoryOptions } from \"../options.js\";\nimport { addAcceptedIssues } from \"./adding/addAcceptedIssues.js\";\nimport { addMergedPulls } from \"./adding/addMergedPulls.js\";\nimport { createOctokit } from \"./api.js\";\nimport { collectAcceptedIssues } from \"./collecting/collectAcceptedIssues.js\";\nimport { collectIssueEvents } from \"./collecting/collectIssueEvents.js\";\nimport { collectMergedPulls } from \"./collecting/collectMergedPulls.js\";\nimport { collectRepoEvents } from \"./collecting/collectRepoEvents.js\";\nimport { processContributors } from \"./processing/processContributors.js\";\n\nexport async function collect(\n\toptions: AllContributorsForRepositoryOptions,\n): Promise<ContributorsContributions> {\n\tconst defaults = { owner: options.owner, repo: options.repo };\n\tconst octokit = await createOctokit(options.auth);\n\n\t// 1. Collect event data from the GitHub API\n\tconst [acceptedIssues, issueEvents, mergedPulls, repoEvents] =\n\t\tawait Promise.all([\n\t\t\tcollectAcceptedIssues(\n\t\t\t\tdefaults,\n\t\t\t\toctokit,\n\t\t\t\toptions.labelAcceptingPrs,\n\t\t\t\toptions.since,\n\t\t\t),\n\t\t\tcollectIssueEvents(defaults, octokit, options.since),\n\t\t\tcollectMergedPulls(defaults, octokit, options.since),\n\t\t\tcollectRepoEvents(defaults, octokit, options.since),\n\t\t]);\n\n\t// 2. Process individual contributors from those events\n\tconst contributors = processContributors(issueEvents, repoEvents, options);\n\n\t// 3. Add additional contributors based on issues and pulls\n\taddAcceptedIssues(Object.values(acceptedIssues), contributors, options);\n\tawait addMergedPulls(mergedPulls, contributors, octokit
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/collect/index.ts"],"sourcesContent":["import { ContributorsContributions } from \"../ContributorsCollection.js\";\nimport { AllContributorsForRepositoryOptions } from \"../options.js\";\nimport { addAcceptedIssues } from \"./adding/addAcceptedIssues.js\";\nimport { addMergedPulls } from \"./adding/addMergedPulls.js\";\nimport { createOctokit } from \"./api.js\";\nimport { collectAcceptedIssues } from \"./collecting/collectAcceptedIssues.js\";\nimport { collectIssueEvents } from \"./collecting/collectIssueEvents.js\";\nimport { collectMergedPulls } from \"./collecting/collectMergedPulls.js\";\nimport { collectRepoEvents } from \"./collecting/collectRepoEvents.js\";\nimport { processContributors } from \"./processing/processContributors.js\";\n\nexport async function collect(\n\toptions: AllContributorsForRepositoryOptions,\n): Promise<ContributorsContributions> {\n\tconst defaults = { owner: options.owner, repo: options.repo };\n\tconst octokit = await createOctokit(options.auth);\n\n\t// 1. Collect event data from the GitHub API\n\tconst [acceptedIssues, issueEvents, mergedPulls, repoEvents] =\n\t\tawait Promise.all([\n\t\t\tcollectAcceptedIssues(\n\t\t\t\tdefaults,\n\t\t\t\toctokit,\n\t\t\t\toptions.labelAcceptingPrs,\n\t\t\t\toptions.since,\n\t\t\t),\n\t\t\tcollectIssueEvents(defaults, octokit, options.since),\n\t\t\tcollectMergedPulls(defaults, octokit, options.since),\n\t\t\tcollectRepoEvents(defaults, octokit, options.since),\n\t\t]);\n\n\t// 2. Process individual contributors from those events\n\tconst contributors = processContributors(issueEvents, repoEvents, options);\n\n\t// 3. Add additional contributors based on issues and pulls\n\taddAcceptedIssues(Object.values(acceptedIssues), contributors, options);\n\tawait addMergedPulls(mergedPulls, contributors, octokit);\n\n\t// 4. Collect the contributions under each contributor\n\treturn contributors.collect();\n}\n"],"mappings":";;;;;;;;;AAWA,eAAsB,QACrB,SACqC;CACrC,MAAM,WAAW;EAAE,OAAO,QAAQ;EAAO,MAAM,QAAQ;CAAK;CAC5D,MAAM,UAAU,MAAM,cAAc,QAAQ,IAAI;CAGhD,MAAM,CAAC,gBAAgB,aAAa,aAAa,cAChD,MAAM,QAAQ,IAAI;EACjB,sBACC,UACA,SACA,QAAQ,mBACR,QAAQ,KACT;EACA,mBAAmB,UAAU,SAAS,QAAQ,KAAK;EACnD,mBAAmB,UAAU,SAAS,QAAQ,KAAK;EACnD,kBAAkB,UAAU,SAAS,QAAQ,KAAK;CACnD,CAAC;CAGF,MAAM,eAAe,oBAAoB,aAAa,YAAY,OAAO;CAGzE,kBAAkB,OAAO,OAAO,cAAc,GAAG,cAAc,OAAO;CACtE,MAAM,eAAe,aAAa,cAAc,OAAO;CAGvD,OAAO,aAAa,QAAQ;AAC7B"}
|
package/lib/options.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export interface AllContributorsForRepositoryOptions {
|
|
|
10
10
|
owner: string;
|
|
11
11
|
repo: string;
|
|
12
12
|
since?: Date;
|
|
13
|
-
testFiles: RegExp[];
|
|
14
13
|
}
|
|
15
14
|
export interface RawAllContributorsForRepositoryOptions {
|
|
16
15
|
/**
|
|
@@ -54,10 +53,6 @@ export interface RawAllContributorsForRepositoryOptions {
|
|
|
54
53
|
* Useful for repeated runs, to avoid re-requesting contributions that were already seen.
|
|
55
54
|
*/
|
|
56
55
|
since?: Date;
|
|
57
|
-
/**
|
|
58
|
-
* Regular expressions for file paths that count as tests, for merged PRs to be given a `test` contribution.
|
|
59
|
-
*/
|
|
60
|
-
testFiles?: RegExp[];
|
|
61
56
|
}
|
|
62
57
|
export declare function fillInOptions(rawOptions: RawAllContributorsForRepositoryOptions): AllContributorsForRepositoryOptions;
|
|
63
58
|
//#endregion
|
package/lib/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","names":[],"sources":["../src/options.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"options.d.ts","names":[],"sources":["../src/options.ts"],"mappings":";iBAgBiB;EAChB;EACA,eAAe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;;iBAGQ;;;;EAIhB;;;;EAKA,gBAAgB;;;;EAKhB;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;;EAMA,QAAQ;;wBAGO,cACf,YAAY,yCACV"}
|
package/lib/options.js
CHANGED
|
@@ -12,8 +12,7 @@ const defaultOptions = {
|
|
|
12
12
|
labelTypeBug: "type: bug",
|
|
13
13
|
labelTypeDocs: "type: documentation",
|
|
14
14
|
labelTypeIdeas: "type: feature",
|
|
15
|
-
labelTypeTool: "area: tooling"
|
|
16
|
-
testFiles: [/\.(spec|test)\.[^/]+$/i, /(^|\/)(__tests__|tests?)\//i]
|
|
15
|
+
labelTypeTool: "area: tooling"
|
|
17
16
|
};
|
|
18
17
|
function fillInOptions(rawOptions) {
|
|
19
18
|
return {
|
|
@@ -26,8 +25,7 @@ function fillInOptions(rawOptions) {
|
|
|
26
25
|
labelTypeTool: rawOptions.labelTypeTool ?? defaultOptions.labelTypeTool,
|
|
27
26
|
owner: rawOptions.owner,
|
|
28
27
|
repo: rawOptions.repo,
|
|
29
|
-
since: rawOptions.since
|
|
30
|
-
testFiles: rawOptions.testFiles ?? defaultOptions.testFiles
|
|
28
|
+
since: rawOptions.since
|
|
31
29
|
};
|
|
32
30
|
}
|
|
33
31
|
//#endregion
|
package/lib/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","names":[],"sources":["../src/options.ts"],"sourcesContent":["const defaultOptions = {\n\tignoredLogins: [\n\t\t/\\[bot\\]$/i,\n\t\t/^allcontributors$/i,\n\t\t/^copilot$/i,\n\t\t/^dependabot$/i,\n\t\t/^github-actions$/i,\n\t\t/^renovate$/i,\n\t],\n\tlabelAcceptingPrs: \"status: accepting prs\",\n\tlabelTypeBug: \"type: bug\",\n\tlabelTypeDocs: \"type: documentation\",\n\tlabelTypeIdeas: \"type: feature\",\n\tlabelTypeTool: \"area: tooling\",\n
|
|
1
|
+
{"version":3,"file":"options.js","names":[],"sources":["../src/options.ts"],"sourcesContent":["const defaultOptions = {\n\tignoredLogins: [\n\t\t/\\[bot\\]$/i,\n\t\t/^allcontributors$/i,\n\t\t/^copilot$/i,\n\t\t/^dependabot$/i,\n\t\t/^github-actions$/i,\n\t\t/^renovate$/i,\n\t],\n\tlabelAcceptingPrs: \"status: accepting prs\",\n\tlabelTypeBug: \"type: bug\",\n\tlabelTypeDocs: \"type: documentation\",\n\tlabelTypeIdeas: \"type: feature\",\n\tlabelTypeTool: \"area: tooling\",\n};\n\nexport interface AllContributorsForRepositoryOptions {\n\tauth?: string;\n\tignoredLogins: RegExp[];\n\tlabelAcceptingPrs: string;\n\tlabelTypeBug: string;\n\tlabelTypeDocs: string;\n\tlabelTypeIdeas: string;\n\tlabelTypeTool: string;\n\towner: string;\n\trepo: string;\n\tsince?: Date;\n}\n\nexport interface RawAllContributorsForRepositoryOptions {\n\t/**\n\t * GitHub auth token to query the API with, if necessary for private repositories and/or to avoid rate limiting.\n\t */\n\tauth?: string;\n\n\t/**\n\t * Regular expressions for usernames to ignore commits from, such as bot users.\n\t */\n\tignoredLogins?: RegExp[];\n\n\t/**\n\t * Label to indicate an issue is accepting pull requests.\n\t */\n\tlabelAcceptingPrs?: string;\n\n\t/**\n\t * Label to indicate an issue is for a bug.\n\t */\n\tlabelTypeBug?: string;\n\n\t/**\n\t * Label to indicate an issue is for documentation.\n\t */\n\tlabelTypeDocs?: string;\n\n\t/**\n\t * Label to indicate an issue is for a feature.\n\t */\n\tlabelTypeIdeas?: string;\n\n\t/**\n\t * Label to indicate an issue is for tooling.\n\t */\n\tlabelTypeTool?: string;\n\n\t/**\n\t * The owner of the repository to query, such as `\"JoshuaKGoldberg\"`.\n\t */\n\towner: string;\n\n\t/**\n\t * The name of the repository to query, such as `\"all-contributors-for-repository\"`.\n\t */\n\trepo: string;\n\n\t/**\n\t * Only include contributions made at or after this time.\n\t * Useful for repeated runs, to avoid re-requesting contributions that were already seen.\n\t */\n\tsince?: Date;\n}\n\nexport function fillInOptions(\n\trawOptions: RawAllContributorsForRepositoryOptions,\n): AllContributorsForRepositoryOptions {\n\treturn {\n\t\tauth: rawOptions.auth,\n\t\tignoredLogins: rawOptions.ignoredLogins ?? defaultOptions.ignoredLogins,\n\t\tlabelAcceptingPrs:\n\t\t\trawOptions.labelAcceptingPrs ?? defaultOptions.labelAcceptingPrs,\n\t\tlabelTypeBug: rawOptions.labelTypeBug ?? defaultOptions.labelTypeBug,\n\t\tlabelTypeDocs: rawOptions.labelTypeDocs ?? defaultOptions.labelTypeDocs,\n\t\tlabelTypeIdeas: rawOptions.labelTypeIdeas ?? defaultOptions.labelTypeIdeas,\n\t\tlabelTypeTool: rawOptions.labelTypeTool ?? defaultOptions.labelTypeTool,\n\t\towner: rawOptions.owner,\n\t\trepo: rawOptions.repo,\n\t\tsince: rawOptions.since,\n\t};\n}\n"],"mappings":";AAAA,MAAM,iBAAiB;CACtB,eAAe;EACd;EACA;EACA;EACA;EACA;EACA;CACD;CACA,mBAAmB;CACnB,cAAc;CACd,eAAe;CACf,gBAAgB;CAChB,eAAe;AAChB;AAoEA,SAAgB,cACf,YACsC;CACtC,OAAO;EACN,MAAM,WAAW;EACjB,eAAe,WAAW,iBAAiB,eAAe;EAC1D,mBACC,WAAW,qBAAqB,eAAe;EAChD,cAAc,WAAW,gBAAgB,eAAe;EACxD,eAAe,WAAW,iBAAiB,eAAe;EAC1D,gBAAgB,WAAW,kBAAkB,eAAe;EAC5D,eAAe,WAAW,iBAAiB,eAAe;EAC1D,OAAO,WAAW;EAClB,MAAM,WAAW;EACjB,OAAO,WAAW;CACnB;AACD"}
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { PaginatingOctokit, RequestDefaults } from "../api.js";
|
|
2
|
-
//#region src/collect/collecting/collectPullFiles.d.ts
|
|
3
|
-
export type PullFile = Awaited<ReturnType<typeof collectPullFiles>>[number];
|
|
4
|
-
export declare function collectPullFiles(defaults: RequestDefaults, octokit: PaginatingOctokit, pullNumber: number): Promise<{
|
|
5
|
-
sha: string | null;
|
|
6
|
-
filename: string;
|
|
7
|
-
status: "added" | "removed" | "modified" | "renamed" | "copied" | "changed" | "unchanged";
|
|
8
|
-
additions: number;
|
|
9
|
-
deletions: number;
|
|
10
|
-
changes: number;
|
|
11
|
-
blob_url: string;
|
|
12
|
-
raw_url: string;
|
|
13
|
-
contents_url: string;
|
|
14
|
-
patch?: string;
|
|
15
|
-
previous_filename?: string;
|
|
16
|
-
}[]>;
|
|
17
|
-
//#endregion
|
|
18
|
-
//# sourceMappingURL=collectPullFiles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collectPullFiles.d.ts","names":[],"sources":["../../../src/collect/collecting/collectPullFiles.ts"],"mappings":";;YAOY,WAAW,QAAQ,kBAAkB;wBAE3B,iBACrB,UAAU,iBACV,SAAS,mBACT,qBAAkB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { paginate } from "../api.js";
|
|
2
|
-
//#region src/collect/collecting/collectPullFiles.ts
|
|
3
|
-
async function collectPullFiles(defaults, octokit, pullNumber) {
|
|
4
|
-
return await paginate(octokit.paginate.iterator("GET /repos/{owner}/{repo}/pulls/{pull_number}/files", {
|
|
5
|
-
...defaults,
|
|
6
|
-
per_page: 100,
|
|
7
|
-
pull_number: pullNumber
|
|
8
|
-
}));
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
11
|
-
export { collectPullFiles };
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=collectPullFiles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collectPullFiles.js","names":[],"sources":["../../../src/collect/collecting/collectPullFiles.ts"],"sourcesContent":["import {\n\tpaginate,\n\tPaginatingOctokit,\n\tperPage,\n\tRequestDefaults,\n} from \"../api.js\";\n\nexport type PullFile = Awaited<ReturnType<typeof collectPullFiles>>[number];\n\nexport async function collectPullFiles(\n\tdefaults: RequestDefaults,\n\toctokit: PaginatingOctokit,\n\tpullNumber: number,\n) {\n\treturn await paginate(\n\t\toctokit.paginate.iterator(\n\t\t\t\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\",\n\t\t\t{\n\t\t\t\t...defaults,\n\t\t\t\tper_page: perPage,\n\t\t\t\tpull_number: pullNumber,\n\t\t\t},\n\t\t),\n\t);\n}\n"],"mappings":";;AASA,eAAsB,iBACrB,UACA,SACA,YACC;CACD,OAAO,MAAM,SACZ,QAAQ,SAAS,SAChB,uDACA;EACC,GAAG;EACH,UAAA;EACA,aAAa;CACd,CACD,CACD;AACD"}
|