@foss.global/codefeed 1.8.0 → 1.10.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/.smartconfig.json +1 -1
- package/changelog.md +168 -0
- package/dist_ts/00_commitinfo_data.js +3 -3
- package/dist_ts/classes.errors.d.ts +3 -0
- package/dist_ts/classes.errors.js +7 -0
- package/dist_ts/classes.gitmanagerprovider.d.ts +22 -0
- package/dist_ts/classes.gitmanagerprovider.js +129 -0
- package/dist_ts/classes.gitmanagerpublicclient.d.ts +62 -0
- package/dist_ts/classes.gitmanagerpublicclient.js +648 -0
- package/dist_ts/index.d.ts +5 -0
- package/dist_ts/index.js +11 -1
- package/dist_ts/plugins.d.ts +9 -1
- package/dist_ts/plugins.js +2 -2
- package/package.json +8 -6
- package/readme.md +86 -2
- package/ts/00_commitinfo_data.ts +2 -2
- package/ts/classes.errors.ts +6 -0
- package/ts/classes.gitmanagerprovider.ts +157 -0
- package/ts/classes.gitmanagerpublicclient.ts +856 -0
- package/ts/index.ts +13 -0
- package/ts/plugins.ts +10 -1
package/.smartconfig.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"githost": "code.foss.global",
|
|
6
6
|
"gitscope": "foss.global",
|
|
7
7
|
"gitrepo": "codefeed",
|
|
8
|
-
"description": "The @foss.global/codefeed module
|
|
8
|
+
"description": "The @foss.global/codefeed module generates commit/activity feeds from forge providers including Gitea and GitManager.",
|
|
9
9
|
"npmPackagename": "@foss.global/codefeed",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"projectDomain": "foss.global",
|
package/changelog.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2026-07-20 - 1.10.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- add a default-deny GitManager public read client (public-api)
|
|
8
|
+
- Map GitManager repositories, organizations, trees, files, commits, diffs, tags, releases, activity, and language summaries into the shared public request response models.
|
|
9
|
+
- Require an authoritative public-repository predicate unless all managed repositories are explicitly declared public.
|
|
10
|
+
- Bound query, commit, release, language scan, and concurrency work while validating repository, path, URL, and commit inputs.
|
|
11
|
+
|
|
12
|
+
### Maintenance
|
|
13
|
+
|
|
14
|
+
- adopt `@foss.global/interfaces` 0.4 and `@foss.global/gitmanager` 0.4, publish the changelog, and update policy-eligible tooling versions (tooling)
|
|
15
|
+
|
|
16
|
+
## 2026-06-23 - 1.9.0
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- add GitManager provider adapter (gitmanager-provider)
|
|
21
|
+
- Add CodeFeedGitManagerProvider for repositories, commits, tags, and changelog content from @foss.global/gitmanager.
|
|
22
|
+
- Export the provider options and completeness error for GitManager-backed feeds.
|
|
23
|
+
- Propagate provider completeness errors to avoid silently returning incomplete bounded listings.
|
|
24
|
+
- Document GitManager usage and add provider coverage tests.
|
|
25
|
+
|
|
26
|
+
## 2026-06-23 - 1.8.0
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
- add provider abstraction and shared interfaces integration
|
|
31
|
+
- Consume `@foss.global/interfaces` for the canonical codefeed commit result contract.
|
|
32
|
+
- Add `ICodeFeedProvider` for alternate read backends while preserving the default Gitea behavior.
|
|
33
|
+
- Lazy-load npm registry checks and migrate tests to deterministic `@git.zone/tstest` coverage.
|
|
34
|
+
|
|
35
|
+
### Fixes
|
|
36
|
+
|
|
37
|
+
- migrate project metadata to smartconfig (tooling)
|
|
38
|
+
- migrate project metadata from npmextra.json to .smartconfig.json
|
|
39
|
+
- include .smartconfig.json in published package files instead of npmextra.json
|
|
40
|
+
- update development build tooling dependencies and Node.js type definitions
|
|
41
|
+
- remove unused TypeScript path configuration
|
|
42
|
+
|
|
43
|
+
## 2025-09-14 - 1.7.2 - fix(core)
|
|
44
|
+
Stabilize pagination, tag mapping, changelog parsing, and HTTP retry/backoff; add tests and caching improvements
|
|
45
|
+
|
|
46
|
+
- Handle paginated orgs, repos, commits, and tags to avoid missing pages.
|
|
47
|
+
- Map tags to commit SHAs and extract version strings from tag names for changelog lookup and optional npm publish detection.
|
|
48
|
+
- Discover and parse repository CHANGELOG files from multiple candidate paths to extract per-version entries.
|
|
49
|
+
- Implement retries with exponential backoff for 429/5xx and network errors in fetchFunction.
|
|
50
|
+
- Add in-memory caching with window trimming, stable sorting, and optional tagged-only filtering.
|
|
51
|
+
- Include tests: mocked pagination & tag mapping test and integration test scaffolding using @push.rocks/tapbundle.
|
|
52
|
+
|
|
53
|
+
## 2025-04-25 - 1.7.1 - fix(CodeFeed)
|
|
54
|
+
Improve commit fetching concurrency and add tagged-only commit filtering along with updated documentation and tests
|
|
55
|
+
|
|
56
|
+
- Updated readme examples to clarify default and options usage, including caching and tagged-only filtering
|
|
57
|
+
- Increased non-exclusive concurrency from 5 to 20 in fetchAllCommitsFromInstance
|
|
58
|
+
- Added tagged-only filtering logic for both cached and non-cached commit results
|
|
59
|
+
- Modified tests to enable tagged-only mode and require npm check
|
|
60
|
+
|
|
61
|
+
## 2025-04-25 - 1.7.0 - feat(core)
|
|
62
|
+
Enhance commit fetching with caching, concurrency improvements, and dependency upgrades
|
|
63
|
+
|
|
64
|
+
- Updated development dependencies (@git.zone/tsbuild, @git.zone/tsbundle, @git.zone/tstest, @push.rocks/tapbundle, @types/node) and dependency versions
|
|
65
|
+
- Introduced optional caching options (enableCache, cacheWindowMs, enableNpmCheck) in the CodeFeed constructor to optimize commit retrieval
|
|
66
|
+
- Refactored commit fetching to use AsyncExecutionStack for controlled concurrency and improved performance
|
|
67
|
+
- Removed deprecated ts/codefeed.plugins.ts in favor of a consolidated plugins.ts module
|
|
68
|
+
|
|
69
|
+
## 2024-12-16 - 1.6.5 - fix(CodeFeed)
|
|
70
|
+
Fixed timestamp initialization and commit fetching timeframe
|
|
71
|
+
|
|
72
|
+
- Updated the lastRunTimestamp initialization default period from 24 hours to 7 days in CodeFeed constructor.
|
|
73
|
+
- Modified commit fetching logic to consider commits from the last 7 days instead of 24 hours in fetchRecentCommitsForRepo.
|
|
74
|
+
|
|
75
|
+
## 2024-12-14 - 1.6.4 - fix(core)
|
|
76
|
+
Refactor fetch logic to use a unified fetchFunction for API calls
|
|
77
|
+
|
|
78
|
+
- Consolidated API request logic in the CodeFeed class to use fetchFunction for improved maintainability.
|
|
79
|
+
|
|
80
|
+
## 2024-12-14 - 1.6.3 - fix(codefeed)
|
|
81
|
+
Refactor and fix formatting issues in the CodeFeed module
|
|
82
|
+
|
|
83
|
+
- Refactored various method format and spacing.
|
|
84
|
+
- Fixed error handling formatting for readability.
|
|
85
|
+
- Improved consistency in JSON handling for API responses.
|
|
86
|
+
|
|
87
|
+
## 2024-12-14 - 1.6.2 - fix(core)
|
|
88
|
+
Fix sorting order of tagged commits by timestamp
|
|
89
|
+
|
|
90
|
+
- Fixed the sorting order of commits to be by timestamp in descending order after filtering for tagged commits.
|
|
91
|
+
|
|
92
|
+
## 2024-12-14 - 1.6.1 - fix(docs)
|
|
93
|
+
Updated project metadata and expanded documentation for installation and usage.
|
|
94
|
+
|
|
95
|
+
- Updated description and keywords in package.json and npmextra.json.
|
|
96
|
+
- Significant expansion of the README.md with detailed installation, usage, and feature instructions.
|
|
97
|
+
|
|
98
|
+
## 2024-12-14 - 1.6.0 - feat(core)
|
|
99
|
+
Add changelog fetching and parsing functionality
|
|
100
|
+
|
|
101
|
+
- Implemented loadChangelogFromRepo to directly load the changelog from a Gitea repository.
|
|
102
|
+
- Introduced parsing functionality to extract specific version details from the loaded changelog.
|
|
103
|
+
- Updated CodeFeed class to utilize the changelog for version verification and commit processing.
|
|
104
|
+
|
|
105
|
+
## 2024-12-14 - 1.5.3 - fix(core)
|
|
106
|
+
Fix filtering logic for returning only tagged commits
|
|
107
|
+
|
|
108
|
+
- Ensure `allCommits` is filtered to only include commits with 'tagged' status before returning.
|
|
109
|
+
|
|
110
|
+
## 2024-12-14 - 1.5.2 - fix(core)
|
|
111
|
+
Ensure stability of core functionalities.
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## 2024-12-14 - 1.5.1 - fix(core)
|
|
115
|
+
Refine logging format in CodeFeed class
|
|
116
|
+
|
|
117
|
+
- Modified console log format in fetchAllCommitsFromInstance method for better readability.
|
|
118
|
+
|
|
119
|
+
## 2024-12-14 - 1.5.0 - feat(core)
|
|
120
|
+
Refactor TypeScript interfaces and improve module exports
|
|
121
|
+
|
|
122
|
+
- Moved TypeScript interfaces to a dedicated file (ts/interfaces/index.ts).
|
|
123
|
+
- Updated import/export structure to improve code readability and maintainability.
|
|
124
|
+
- Enhanced the package.json to utilize a module exports field for better resolution.
|
|
125
|
+
|
|
126
|
+
## 2024-12-13 - 1.4.1 - fix(core)
|
|
127
|
+
Corrected log formatting for commit information output in CodeFeed
|
|
128
|
+
|
|
129
|
+
- Fixed formatting issue in commit log output within the CodeFeed class to ensure proper display of timestamps.
|
|
130
|
+
|
|
131
|
+
## 2024-12-13 - 1.4.0 - feat(CodeFeed)
|
|
132
|
+
Enhance commit results with human-readable time
|
|
133
|
+
|
|
134
|
+
- Integrated smarttime plugin to calculate and format timestamps into human-readable time.
|
|
135
|
+
- Updated dependencies in package.json to include smarttime and adjusted versions for existing packages.
|
|
136
|
+
- Improved fetchAllCommitsFromInstance method to display formatted time ago information for each commit.
|
|
137
|
+
|
|
138
|
+
## 2024-12-13 - 1.3.0 - feat(core)
|
|
139
|
+
Export CommitResult interface for external use.
|
|
140
|
+
|
|
141
|
+
- Changed CommitResult from a local interface to an exported interface, allowing for external usage and integration.
|
|
142
|
+
|
|
143
|
+
## 2024-12-13 - 1.2.1 - fix(core)
|
|
144
|
+
No changes detected
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
## 2024-12-13 - 1.2.0 - feat(core)
|
|
148
|
+
Add organization-level activity fetching and RSS parsing
|
|
149
|
+
|
|
150
|
+
- Integrated smartxml package for XML parsing.
|
|
151
|
+
- Implemented fetching of all organizations within a Gitea instance.
|
|
152
|
+
- Added functionality to check new activities in organization RSS feeds.
|
|
153
|
+
- Enhanced fetching logic to include repository commits and tags.
|
|
154
|
+
|
|
155
|
+
## 2024-12-13 - 1.1.0 - feat(core)
|
|
156
|
+
Add tracking of commits published on npm
|
|
157
|
+
|
|
158
|
+
- Introduced a check for published commits on npm using smartnpm.
|
|
159
|
+
- Enhanced fetchAllCommitsFromInstance to include 'publishedOnNpm' status in results.
|
|
160
|
+
|
|
161
|
+
## 2024-12-13 - 1.0.2 - fix(core)
|
|
162
|
+
Improve error handling in fetchRecentCommitsForRepo method
|
|
163
|
+
|
|
164
|
+
- Refined the console error message for better clarity.
|
|
165
|
+
- Updated the fetchRecentCommitsForRepo method to stop fetching when encountering a commit older than 24 hours.
|
|
166
|
+
|
|
167
|
+
## 2024-12-13 - 1.0.1 - initial release
|
|
168
|
+
Initial release of the project
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@foss.global/codefeed',
|
|
6
|
-
version: '1.
|
|
7
|
-
description: 'The @foss.global/codefeed module
|
|
6
|
+
version: '1.10.0',
|
|
7
|
+
description: 'The @foss.global/codefeed module generates commit/activity feeds from forge providers including Gitea and GitManager.'
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx1QkFBdUI7SUFDN0IsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLHVIQUF1SDtDQUNySSxDQUFBIn0=
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export class CodeFeedProviderCompletenessError extends Error {
|
|
2
|
+
constructor(messageArg) {
|
|
3
|
+
super(messageArg);
|
|
4
|
+
this.name = 'CodeFeedProviderCompletenessError';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy5lcnJvcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9jbGFzc2VzLmVycm9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLE9BQU8saUNBQWtDLFNBQVEsS0FBSztJQUMxRCxZQUFZLFVBQWtCO1FBQzVCLEtBQUssQ0FBQyxVQUFVLENBQUMsQ0FBQztRQUNsQixJQUFJLENBQUMsSUFBSSxHQUFHLG1DQUFtQyxDQUFDO0lBQ2xELENBQUM7Q0FDRiJ9
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as plugins from './plugins.js';
|
|
2
|
+
export interface ICodeFeedGitManagerProviderOptions {
|
|
3
|
+
gitManager: plugins.TGitManager;
|
|
4
|
+
commitLimit?: number;
|
|
5
|
+
tagLimit?: number;
|
|
6
|
+
changelogPaths?: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare class CodeFeedGitManagerProvider implements plugins.interfaces.ICodeFeedProvider {
|
|
9
|
+
private gitManager;
|
|
10
|
+
private commitLimit;
|
|
11
|
+
private tagLimit;
|
|
12
|
+
private changelogPaths;
|
|
13
|
+
constructor(optionsArg: ICodeFeedGitManagerProviderOptions);
|
|
14
|
+
listOrganizations(): Promise<string[]>;
|
|
15
|
+
listRepositoriesForOrg(orgArg: string): Promise<plugins.interfaces.IRepository[]>;
|
|
16
|
+
getLatestCommitForRepo(ownerArg: string, repoArg: string): Promise<plugins.interfaces.ICommit | undefined>;
|
|
17
|
+
listCommitsForRepo(ownerArg: string, repoArg: string, sinceTimestampArg?: string): Promise<plugins.interfaces.ICommit[]>;
|
|
18
|
+
listTagsForRepo(ownerArg: string, repoArg: string): Promise<plugins.interfaces.ICodeFeedTagInfo>;
|
|
19
|
+
readChangelogForRepo(ownerArg: string, repoArg: string): Promise<string>;
|
|
20
|
+
private mapCommitSummary;
|
|
21
|
+
private parseSinceTimestamp;
|
|
22
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as plugins from './plugins.js';
|
|
2
|
+
import { CodeFeedProviderCompletenessError } from './classes.errors.js';
|
|
3
|
+
const defaultChangelogPaths = [
|
|
4
|
+
'CHANGELOG.md',
|
|
5
|
+
'changelog.md',
|
|
6
|
+
'Changelog.md',
|
|
7
|
+
'docs/CHANGELOG.md',
|
|
8
|
+
];
|
|
9
|
+
export class CodeFeedGitManagerProvider {
|
|
10
|
+
constructor(optionsArg) {
|
|
11
|
+
this.gitManager = optionsArg.gitManager;
|
|
12
|
+
this.commitLimit = optionsArg.commitLimit ?? 1000;
|
|
13
|
+
this.tagLimit = optionsArg.tagLimit ?? 1000;
|
|
14
|
+
this.changelogPaths = optionsArg.changelogPaths ?? defaultChangelogPaths;
|
|
15
|
+
}
|
|
16
|
+
async listOrganizations() {
|
|
17
|
+
const repositories = await this.gitManager.listRepositories();
|
|
18
|
+
return [...new Set(repositories.map((repository) => repository.org))]
|
|
19
|
+
.sort((a, b) => a.localeCompare(b));
|
|
20
|
+
}
|
|
21
|
+
async listRepositoriesForOrg(orgArg) {
|
|
22
|
+
const repositories = await this.gitManager.listRepositories();
|
|
23
|
+
return repositories
|
|
24
|
+
.filter((repository) => repository.org === orgArg)
|
|
25
|
+
.map((repository) => ({
|
|
26
|
+
owner: {
|
|
27
|
+
login: repository.org,
|
|
28
|
+
},
|
|
29
|
+
name: repository.repo,
|
|
30
|
+
}))
|
|
31
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
32
|
+
}
|
|
33
|
+
async getLatestCommitForRepo(ownerArg, repoArg) {
|
|
34
|
+
const commits = await this.gitManager.listCommits({
|
|
35
|
+
org: ownerArg,
|
|
36
|
+
repo: repoArg,
|
|
37
|
+
limit: 1,
|
|
38
|
+
});
|
|
39
|
+
const [commit] = commits;
|
|
40
|
+
if (!commit) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
return this.mapCommitSummary(commit);
|
|
44
|
+
}
|
|
45
|
+
async listCommitsForRepo(ownerArg, repoArg, sinceTimestampArg) {
|
|
46
|
+
const sinceTimestamp = this.parseSinceTimestamp(sinceTimestampArg);
|
|
47
|
+
const commits = await this.gitManager.listCommits({
|
|
48
|
+
org: ownerArg,
|
|
49
|
+
repo: repoArg,
|
|
50
|
+
limit: this.commitLimit,
|
|
51
|
+
});
|
|
52
|
+
if (sinceTimestamp !== undefined && commits.length >= this.commitLimit) {
|
|
53
|
+
throw new CodeFeedProviderCompletenessError(`GitManager commit listing for ${ownerArg}/${repoArg} reached the configured limit of ${this.commitLimit}; complete since filtering requires GitManager pagination.`);
|
|
54
|
+
}
|
|
55
|
+
const filteredCommits = sinceTimestamp === undefined
|
|
56
|
+
? commits
|
|
57
|
+
: commits.filter((commit) => Date.parse(commit.createdAt) > sinceTimestamp);
|
|
58
|
+
return Promise.all(filteredCommits.map((commit) => this.mapCommitSummary(commit)));
|
|
59
|
+
}
|
|
60
|
+
async listTagsForRepo(ownerArg, repoArg) {
|
|
61
|
+
const taggedShas = new Set();
|
|
62
|
+
const tagNameBySha = new Map();
|
|
63
|
+
const tags = await this.gitManager.listTags({
|
|
64
|
+
org: ownerArg,
|
|
65
|
+
repo: repoArg,
|
|
66
|
+
limit: this.tagLimit,
|
|
67
|
+
});
|
|
68
|
+
if (tags.length >= this.tagLimit) {
|
|
69
|
+
throw new CodeFeedProviderCompletenessError(`GitManager tag listing for ${ownerArg}/${repoArg} reached the configured limit of ${this.tagLimit}; complete tag enrichment requires GitManager pagination.`);
|
|
70
|
+
}
|
|
71
|
+
for (const tag of tags) {
|
|
72
|
+
if (tag.targetObjectType !== 'commit') {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
taggedShas.add(tag.targetObjectId);
|
|
76
|
+
tagNameBySha.set(tag.targetObjectId, tag.name);
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
shas: taggedShas,
|
|
80
|
+
map: tagNameBySha,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
async readChangelogForRepo(ownerArg, repoArg) {
|
|
84
|
+
for (const changelogPath of this.changelogPaths) {
|
|
85
|
+
try {
|
|
86
|
+
const file = await this.gitManager.readFile({
|
|
87
|
+
org: ownerArg,
|
|
88
|
+
repo: repoArg,
|
|
89
|
+
path: changelogPath,
|
|
90
|
+
});
|
|
91
|
+
if (file.isBinary) {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
return Buffer.from(file.contentBase64, 'base64').toString('utf8');
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return '';
|
|
101
|
+
}
|
|
102
|
+
async mapCommitSummary(commitArg) {
|
|
103
|
+
const commitDetail = await this.gitManager.getCommit({
|
|
104
|
+
org: commitArg.org,
|
|
105
|
+
repo: commitArg.repo,
|
|
106
|
+
ref: commitArg.sha,
|
|
107
|
+
});
|
|
108
|
+
return {
|
|
109
|
+
sha: commitDetail.sha,
|
|
110
|
+
commit: {
|
|
111
|
+
message: commitDetail.message,
|
|
112
|
+
author: {
|
|
113
|
+
date: commitDetail.author.date,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
parseSinceTimestamp(sinceTimestampArg) {
|
|
119
|
+
if (!sinceTimestampArg) {
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
const timestamp = Date.parse(sinceTimestampArg);
|
|
123
|
+
if (Number.isNaN(timestamp)) {
|
|
124
|
+
throw new Error(`Invalid since timestamp: ${sinceTimestampArg}`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HQUFHO1lBQ3JCLE1BQU0sRUFBRTtnQkFDTixPQUFPLEVBQUUsWUFBWSxDQUFDLE9BQU87Z0JBQzdCLE1BQU0sRUFBRTtvQkFDTixJQUFJLEVBQUUsWUFBWSxDQUFDLE1BQU0sQ0FBQyxJQUFJO2lCQUMvQjthQUNGO1NBQ0YsQ0FBQztJQUNKLENBQUM7SUFFTyxtQkFBbUIsQ0FBQyxpQkFBMEI7UUFDcEQsSUFBSSxDQUFDLGlCQUFpQixFQUFFLENBQUM7WUFDdkIsT0FBTyxTQUFTLENBQUM7UUFDbkIsQ0FBQztRQUNELE1BQU0sU0FBUyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsaUJBQWlCLENBQUMsQ0FBQztRQUNoRCxJQUFJLE1BQU0sQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQztZQUM1QixNQUFNLElBQUksS0FBSyxDQUFDLDRCQUE0QixpQkFBaUIsRUFBRSxDQUFDLENBQUM7UUFDbkUsQ0FBQztRQUNELE9BQU8sU0FBUyxDQUFDO0lBQ25CLENBQUM7Q0FDRiJ9
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as plugins from './plugins.js';
|
|
2
|
+
export interface IGitManagerPublicReadClientOptions {
|
|
3
|
+
gitManager: plugins.TGitManager;
|
|
4
|
+
publicBaseUrl?: string;
|
|
5
|
+
smartHttpBaseUrl?: string;
|
|
6
|
+
sshBaseUrl?: string;
|
|
7
|
+
allowAllRepositories?: boolean;
|
|
8
|
+
isRepositoryPublic?: (repositoryArg: plugins.TGitManagerRepositoryInfo) => Promise<boolean>;
|
|
9
|
+
organizationMetadata?: (orgArg: string) => Promise<Partial<plugins.fossInterfaces.IPublicOrg> | undefined>;
|
|
10
|
+
repositoryMetadata?: (repositoryArg: plugins.TGitManagerRepositoryInfo) => Promise<Partial<plugins.fossInterfaces.IPublicRepo> | undefined>;
|
|
11
|
+
newsProvider?: (limitArg: number) => Promise<plugins.fossInterfaces.IPublicNewsItem[]>;
|
|
12
|
+
maxCommits?: number;
|
|
13
|
+
maxReleases?: number;
|
|
14
|
+
maxLanguageFiles?: number;
|
|
15
|
+
maxConcurrency?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare class GitManagerPublicReadClient {
|
|
18
|
+
private readonly gitManager;
|
|
19
|
+
private readonly publicBaseUrl;
|
|
20
|
+
private readonly smartHttpBaseUrl;
|
|
21
|
+
private readonly sshBaseUrl;
|
|
22
|
+
private readonly allowAllRepositories;
|
|
23
|
+
private readonly isRepositoryPublic?;
|
|
24
|
+
private readonly organizationMetadata?;
|
|
25
|
+
private readonly repositoryMetadata?;
|
|
26
|
+
private readonly newsProvider?;
|
|
27
|
+
private readonly maxCommits;
|
|
28
|
+
private readonly maxReleases;
|
|
29
|
+
private readonly maxLanguageFiles;
|
|
30
|
+
private readonly maxConcurrency;
|
|
31
|
+
constructor(optionsArg: IGitManagerPublicReadClientOptions);
|
|
32
|
+
getOverview(queryArg?: string): Promise<plugins.fossInterfaces.IReq_PublicOverview['response']>;
|
|
33
|
+
getOrg(orgArg: string): Promise<plugins.fossInterfaces.IReq_PublicOrg['response']>;
|
|
34
|
+
getRepo(orgArg: string, repoArg: string, pathArg?: string, _issueNumberArg?: number): Promise<plugins.fossInterfaces.IReq_PublicRepo['response']>;
|
|
35
|
+
getFile(orgArg: string, repoArg: string, pathArg: string): Promise<plugins.fossInterfaces.IReq_PublicFile['response']>;
|
|
36
|
+
getCommits(orgArg: string, repoArg: string, shaArg?: string): Promise<plugins.fossInterfaces.IReq_PublicCommits['response']>;
|
|
37
|
+
private listVisibleRepositories;
|
|
38
|
+
private findVisibleRepository;
|
|
39
|
+
private mapOrganizations;
|
|
40
|
+
private mapRepository;
|
|
41
|
+
private getCommitFeed;
|
|
42
|
+
private mapCommit;
|
|
43
|
+
private getCommitDetail;
|
|
44
|
+
private mapContent;
|
|
45
|
+
private mapRelease;
|
|
46
|
+
private mapActivity;
|
|
47
|
+
private readReadme;
|
|
48
|
+
private scanLanguages;
|
|
49
|
+
private getStats;
|
|
50
|
+
private getPrimaryLanguage;
|
|
51
|
+
private languageForPath;
|
|
52
|
+
private getActivityKind;
|
|
53
|
+
private mapDiffStatus;
|
|
54
|
+
private repoPathUrl;
|
|
55
|
+
private stableId;
|
|
56
|
+
private normalizeBaseUrl;
|
|
57
|
+
private validateSlug;
|
|
58
|
+
private validatePath;
|
|
59
|
+
private validateLimit;
|
|
60
|
+
private withFallback;
|
|
61
|
+
private mapWithConcurrency;
|
|
62
|
+
}
|