repometry 0.6.2 → 0.8.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 +3 -0
- package/package.json +1 -1
- package/target/main/resources/config/process-plugins-v1.schema.json +79 -0
- package/target/main/resources/languages/go/parser.go +602 -0
- package/target/main/resources/languages/python/parser.py +312 -0
- package/target/main/resources/report/json/report-v2.schema.json +21 -1
- package/target/main/resources/report/json/repository-summary-v1.schema.json +9 -0
- package/target/main/resources/report/json/viewer-inspection-v1.schema.json +12 -3
- package/target/main/resources/viewer/files.css +7 -0
- package/target/main/resources/viewer/index.html +1 -1
- package/target/main/resources/viewer/styles.css +1 -0
- package/target/main/ts/api/git/git-reader.d.ts +10 -2
- package/target/main/ts/api/git/git-reader.js +74 -35
- package/target/main/ts/api/git/git.d.ts +19 -1
- package/target/main/ts/api/git/git.js +97 -7
- package/target/main/ts/api/import/go-cover.d.ts +13 -0
- package/target/main/ts/api/import/go-cover.js +150 -0
- package/target/main/ts/api/import/lcov-files.d.ts +6 -1
- package/target/main/ts/api/import/lcov-files.js +27 -7
- package/target/main/ts/api/process/docker-tool-runner.js +5 -21
- package/target/main/ts/api/process/host-language-runner.d.ts +13 -0
- package/target/main/ts/api/process/host-language-runner.js +176 -0
- package/target/main/ts/api/process/plugin.d.ts +4 -1
- package/target/main/ts/api/process/plugin.js +7 -3
- package/target/main/ts/api/process/tool-snapshot.d.ts +3 -0
- package/target/main/ts/api/process/tool-snapshot.js +26 -0
- package/target/main/ts/cli/config.d.ts +1 -0
- package/target/main/ts/cli/config.js +3 -2
- package/target/main/ts/cli/imports.d.ts +1 -0
- package/target/main/ts/cli/imports.js +5 -2
- package/target/main/ts/cli/main.js +76 -27
- package/target/main/ts/cli/reporting.js +3 -3
- package/target/main/ts/compose/analysis-files.d.ts +3 -1
- package/target/main/ts/compose/analysis-files.js +46 -12
- package/target/main/ts/compose/analysis-imports.js +4 -2
- package/target/main/ts/compose/analysis-report.d.ts +1 -0
- package/target/main/ts/compose/analysis-report.js +20 -15
- package/target/main/ts/compose/analysis-repository.d.ts +2 -1
- package/target/main/ts/compose/analysis-repository.js +42 -4
- package/target/main/ts/compose/analysis-results.d.ts +4 -1
- package/target/main/ts/compose/analysis-results.js +3 -0
- package/target/main/ts/compose/analysis-sources.d.ts +5 -0
- package/target/main/ts/compose/analysis-sources.js +11 -3
- package/target/main/ts/compose/analyze-snapshot.d.ts +2 -1
- package/target/main/ts/compose/analyze-snapshot.js +5 -3
- package/target/main/ts/compose/diff-coverage.d.ts +2 -1
- package/target/main/ts/compose/diff-coverage.js +8 -6
- package/target/main/ts/compose/history-cache.d.ts +29 -0
- package/target/main/ts/compose/history-cache.js +57 -0
- package/target/main/ts/compose/inspect.d.ts +6 -1
- package/target/main/ts/compose/inspect.js +10 -10
- package/target/main/ts/compose/inspection-coverage.d.ts +9 -0
- package/target/main/ts/compose/inspection-coverage.js +9 -0
- package/target/main/ts/compose/languages.d.ts +6 -1
- package/target/main/ts/compose/languages.js +23 -7
- package/target/main/ts/compose/native-language-plugins.d.ts +6 -0
- package/target/main/ts/compose/native-language-plugins.js +40 -0
- package/target/main/ts/compose/plugin-list.d.ts +7 -3
- package/target/main/ts/compose/plugin-list.js +13 -3
- package/target/main/ts/compose/prepare-metabranch.js +1 -1
- package/target/main/ts/compose/process-plugins.d.ts +2 -0
- package/target/main/ts/compose/process-plugins.js +64 -0
- package/target/main/ts/compose/review.d.ts +1 -2
- package/target/main/ts/compose/review.js +2 -2
- package/target/main/ts/compose/structure-measures.d.ts +5 -0
- package/target/main/ts/compose/structure-measures.js +57 -0
- package/target/main/ts/core/engine/manifest.js +5 -1
- package/target/main/ts/core/engine/plan.js +5 -6
- package/target/main/ts/core/engine/plugin.d.ts +2 -0
- package/target/main/ts/core/model/clone-source.js +0 -1
- package/target/main/ts/core/model/code-structure.d.ts +14 -9
- package/target/main/ts/core/model/code-structure.js +23 -10
- package/target/main/ts/core/model/file-types.d.ts +1 -0
- package/target/main/ts/core/model/file-types.js +14 -3
- package/target/main/ts/core/model/language.d.ts +2 -0
- package/target/main/ts/core/model/plugin-data.d.ts +2 -0
- package/target/main/ts/core/model/quality-summary.d.ts +4 -0
- package/target/main/ts/core/model/quality-summary.js +55 -29
- package/target/main/ts/core/model/report.d.ts +6 -0
- package/target/main/ts/core/model/source.d.ts +2 -0
- package/target/main/ts/core/usecases/inspect.d.ts +1 -1
- package/target/main/ts/core/usecases/inspect.js +1 -1
- package/target/main/ts/plugin.d.ts +1 -1
- package/target/main/ts/plugins/coverage/coverage.d.ts +2 -1
- package/target/main/ts/plugins/coverage/coverage.js +40 -30
- package/target/main/ts/plugins/language-js/function-facts.d.ts +1 -1
- package/target/main/ts/plugins/language-js/function-facts.js +0 -1
- package/target/main/ts/plugins/language-js/js-security.js +25 -37
- package/target/main/ts/plugins/language-js/structural-observations.js +5 -4
- package/target/main/ts/plugins/maintainability/maintainability.d.ts +1 -1
- package/target/main/ts/plugins/maintainability/maintainability.js +9 -8
- package/target/main/ts/plugins/security/dockerfile.js +51 -52
- package/target/main/ts/plugins/structure/structure.js +2 -2
- package/target/main/ts/report/html/app/viewer-code-map.js +6 -5
- package/target/main/ts/report/html/app/viewer-columns.d.ts +2 -0
- package/target/main/ts/report/html/app/viewer-columns.js +9 -4
- package/target/main/ts/report/html/app/viewer-data.d.ts +2 -1
- package/target/main/ts/report/html/app/viewer-data.js +1 -1
- package/target/main/ts/report/html/app/viewer-file-aside.d.ts +5 -9
- package/target/main/ts/report/html/app/viewer-file-aside.js +18 -8
- package/target/main/ts/report/html/app/viewer-file-figures.d.ts +2 -0
- package/target/main/ts/report/html/app/viewer-file-figures.js +6 -1
- package/target/main/ts/report/html/app/viewer-hotspots.js +7 -5
- package/target/main/ts/report/html/app/viewer-inspection.js +1 -1
- package/target/main/ts/report/html/app/viewer-issue-group.js +2 -2
- package/target/main/ts/report/html/app/viewer-language-bar.d.ts +2 -0
- package/target/main/ts/report/html/app/viewer-language-bar.js +5 -1
- package/target/main/ts/report/html/app/viewer-languages.d.ts +3 -2
- package/target/main/ts/report/html/app/viewer-languages.js +14 -7
- package/target/main/ts/report/html/app/viewer-line-coverage.d.ts +4 -4
- package/target/main/ts/report/html/app/viewer-line-coverage.js +11 -24
- package/target/main/ts/report/html/app/viewer-map-scale.d.ts +1 -1
- package/target/main/ts/report/html/app/viewer-map-scale.js +1 -1
- package/target/main/ts/report/html/app/viewer-map-shape.d.ts +2 -2
- package/target/main/ts/report/html/app/viewer-metric-registry.d.ts +0 -3
- package/target/main/ts/report/html/app/viewer-metric-registry.js +0 -9
- package/target/main/ts/report/html/app/viewer-metrics-view.js +1 -4
- package/target/main/ts/report/html/app/viewer-metrics.d.ts +2 -0
- package/target/main/ts/report/html/app/viewer-metrics.js +5 -0
- package/target/main/ts/report/html/app/viewer-overview-cards.js +4 -1
- package/target/main/ts/report/html/app/viewer-overview-hotspots.js +2 -2
- package/target/main/ts/report/html/app/viewer-profile.js +22 -1
- package/target/main/ts/report/html/app/viewer-source-view.js +7 -6
- package/target/main/ts/report/html/app/viewer-table-cells.js +8 -2
- package/target/main/ts/report/html/app/viewer-table-rows.d.ts +2 -0
- package/target/main/ts/report/html/app/viewer-table-rows.js +7 -5
- package/target/main/ts/report/html/app/viewer-tokenizer.d.ts +2 -5
- package/target/main/ts/report/html/app/viewer-tokenizer.js +9 -12
- package/target/main/ts/report/html/app/viewer-totals.d.ts +6 -0
- package/target/main/ts/report/html/app/viewer-totals.js +11 -0
- package/target/main/ts/report/html/app/viewer-trend-data.d.ts +1 -1
- package/target/main/ts/report/html/app/viewer-trend-data.js +1 -1
- package/target/main/ts/report/html/app/viewer-trend-nav.js +3 -2
- package/target/main/ts/report/html/app/viewer.js +1 -7
- package/target/main/ts/report/json/projections/commit-summary.d.ts +1 -0
- package/target/main/ts/report/json/projections/commit-summary.js +10 -0
- package/target/main/ts/report/json/projections/file-metrics.js +56 -45
- package/target/main/ts/report/json/projections/inspection-details.js +33 -14
- package/target/main/ts/report/json/projections/metric-values.d.ts +1 -0
- package/target/main/ts/report/json/projections/metric-values.js +36 -3
- package/target/main/ts/report/json/store/directory.d.ts +3 -0
- package/target/main/ts/report/json/store/directory.js +19 -0
- package/target/main/ts/report/json/store/local-store.d.ts +14 -2
- package/target/main/ts/report/json/store/local-store.js +74 -60
- package/target/main/ts/report/json/store/object-store.d.ts +14 -0
- package/target/main/ts/report/json/store/object-store.js +73 -0
- package/target/main/ts/report/json/store/report-tree.d.ts +46 -0
- package/target/main/ts/report/json/store/report-tree.js +290 -0
- package/target/main/ts/report/json/store/store-check.d.ts +32 -0
- package/target/main/ts/report/json/store/store-check.js +144 -0
- package/target/main/ts/report/json/validation/report.d.ts +6 -1
- package/target/main/ts/report/json/validation/report.js +10 -4
- package/target/main/ts/report/json/wire/inspection-details-model.d.ts +9 -1
|
@@ -102,13 +102,7 @@ function start(data) {
|
|
|
102
102
|
updateTabs(page, row.findingCount, row.diagnosticCount);
|
|
103
103
|
else if (cachedDetail)
|
|
104
104
|
updateDetailsTabs(page, cachedDetail);
|
|
105
|
-
|
|
106
|
-
showTab('pulls', pullReviewCount > 0 || page === 'pulls');
|
|
107
|
-
else
|
|
108
|
-
void loadPulls().then(records => {
|
|
109
|
-
if (version === revision)
|
|
110
|
-
showTab('pulls', Boolean(records?.length) || page === 'pulls');
|
|
111
|
-
});
|
|
105
|
+
showTab('pulls', pullReviewCount > 0 || page === 'pulls');
|
|
112
106
|
void detail?.then(asset => {
|
|
113
107
|
if (!asset || version !== revision)
|
|
114
108
|
return;
|
|
@@ -2,6 +2,7 @@ import type { PublicHistoryEntry } from '../wire/public-history-model.js';
|
|
|
2
2
|
import type { Report } from '../validation/report.js';
|
|
3
3
|
import type { CommitSummary, RepositorySummary } from '../wire/summary-model.js';
|
|
4
4
|
export declare function commitSummary(report: Report): CommitSummary;
|
|
5
|
+
export declare function needsMaintainabilityRefresh(row: CommitSummary): boolean;
|
|
5
6
|
export declare function orderSummaries(rows: readonly CommitSummary[]): CommitSummary[];
|
|
6
7
|
export type CommitMetadata = Pick<PublicHistoryEntry, 'subject' | 'author' | 'tags' | 'committedAt'>;
|
|
7
8
|
export type ReadCommitMetadata = (revisions: readonly string[]) => Promise<ReadonlyMap<string, CommitMetadata>>;
|
|
@@ -29,6 +29,11 @@ export function commitSummary(report) {
|
|
|
29
29
|
...(metrics.privateMetrics === undefined ? {} : { privateMetrics: metrics.privateMetrics }) }),
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
+
// Earlier indices recorded zero effort before any file supplied all inputs for a grade.
|
|
33
|
+
export function needsMaintainabilityRefresh(row) {
|
|
34
|
+
const summary = row.quality.maintainability;
|
|
35
|
+
return summary?.grade === null && summary.debtRatio === null && summary.smells === 0 && summary.effortMinutes === 0;
|
|
36
|
+
}
|
|
32
37
|
export function orderSummaries(rows) {
|
|
33
38
|
return [...rows].sort(compareHistoryEntries);
|
|
34
39
|
}
|
|
@@ -106,6 +111,11 @@ export function historyEntry(report) {
|
|
|
106
111
|
lineCoverage = { covered: item.covered, total: item.total };
|
|
107
112
|
}
|
|
108
113
|
}
|
|
114
|
+
const unmeasured = new Set(report.pluginData?.inventory?.flatMap(file => file.unmeasured ?? []));
|
|
115
|
+
if (unmeasured.has('functions'))
|
|
116
|
+
functions = null;
|
|
117
|
+
if (unmeasured.has('cyclomaticComplexity'))
|
|
118
|
+
maxComplexity = null;
|
|
109
119
|
const window = report.appliedConfig.churnWindow;
|
|
110
120
|
const endingAt = isRecord(window) && typeof window.endingAt === 'string' ? window.endingAt : '';
|
|
111
121
|
const committedAt = Date.parse(report.committedAt ?? endingAt);
|
|
@@ -23,8 +23,7 @@ export function fileMetrics(report, registry = { id: fileTypeId, catalog: [] })
|
|
|
23
23
|
function languageIndex(id, analysed) {
|
|
24
24
|
const existing = languageIndexes.get(id);
|
|
25
25
|
if (existing !== undefined) {
|
|
26
|
-
|
|
27
|
-
languages[existing].analysed = true;
|
|
26
|
+
languages[existing].analysed ||= analysed;
|
|
28
27
|
return existing;
|
|
29
28
|
}
|
|
30
29
|
const index = languages.length;
|
|
@@ -45,10 +44,10 @@ export function fileMetrics(report, registry = { id: fileTypeId, catalog: [] })
|
|
|
45
44
|
entry.provider = provider;
|
|
46
45
|
}
|
|
47
46
|
const duplicatedLines = collectMeasurements(report.measurements, file, pluginMetrics !== undefined);
|
|
48
|
-
|
|
47
|
+
const skipped = new Set(report.ruleSkips?.map(({ path }) => path));
|
|
48
|
+
addFileQuality(byPath, duplicatedLines, report.findings, skipped);
|
|
49
49
|
let unassignedDiagnostics = 0;
|
|
50
|
-
for (const
|
|
51
|
-
const { path, operation } = diagnostic;
|
|
50
|
+
for (const { path, operation } of report.diagnostics) {
|
|
52
51
|
const target = path === undefined ? undefined
|
|
53
52
|
: operation === `${legacySyntaxPlugin}/parse` || operation.startsWith('structure/') ? file(path) : byPath.get(path);
|
|
54
53
|
if (target)
|
|
@@ -59,34 +58,20 @@ export function fileMetrics(report, registry = { id: fileTypeId, catalog: [] })
|
|
|
59
58
|
const files = [...byPath.values()].sort(byName);
|
|
60
59
|
const directories = new Map();
|
|
61
60
|
for (const entry of files) {
|
|
62
|
-
|
|
63
|
-
entry.language = languageIndex(registry.id(entry.path), entry.lines !== null || entry.lineCoverage !== null || entry.functions !== null);
|
|
64
|
-
}
|
|
61
|
+
entry.language ??= languageIndex(registry.id(entry.path), entry.lines !== null || entry.lineCoverage !== null || entry.functions !== null);
|
|
65
62
|
if (pluginMetrics && entry.analysed !== false) {
|
|
66
63
|
const values = pluginMetrics.values(entry.path);
|
|
67
64
|
if (Object.keys(values).length)
|
|
68
65
|
entry.values = values;
|
|
69
66
|
}
|
|
70
|
-
if (entry.functions === 0 && !entry.complexity) {
|
|
67
|
+
if (entry.functions === 0 && !entry.complexity && pluginMetrics?.isAvailable(definitions.complexity, entry.path) !== false) {
|
|
71
68
|
entry.complexity = { sum: 0, maximum: null, measuredFunctions: 0 };
|
|
72
69
|
}
|
|
73
|
-
|
|
74
|
-
do {
|
|
75
|
-
path = path.slice(0, Math.max(0, path.lastIndexOf('/')));
|
|
76
|
-
let directory = directories.get(path);
|
|
77
|
-
if (!directory) {
|
|
78
|
-
directory = { ...emptyMetrics(path), files: 0, sizeMeasuredFiles: 0, coverageMeasuredFiles: 0 };
|
|
79
|
-
directories.set(path, directory);
|
|
80
|
-
}
|
|
81
|
-
addFile(directory, entry);
|
|
82
|
-
} while (path !== '');
|
|
70
|
+
rollUpFile(directories, entry);
|
|
83
71
|
}
|
|
84
72
|
if (pluginMetrics) {
|
|
85
|
-
for (const entry of directories.values())
|
|
86
|
-
|
|
87
|
-
if (Object.keys(values).length)
|
|
88
|
-
entry.values = values;
|
|
89
|
-
}
|
|
73
|
+
for (const entry of directories.values())
|
|
74
|
+
applyDirectoryProjection(entry, pluginMetrics);
|
|
90
75
|
}
|
|
91
76
|
const complexity = files.filter(entry => entry.complexity?.maximum != null)
|
|
92
77
|
.sort((left, right) => right.complexity.maximum - left.complexity.maximum
|
|
@@ -141,7 +126,24 @@ function collectMeasurements(rows, file, includeMeasuredFiles) {
|
|
|
141
126
|
}
|
|
142
127
|
return duplicated;
|
|
143
128
|
}
|
|
144
|
-
function
|
|
129
|
+
function applyDirectoryProjection(entry, projection) {
|
|
130
|
+
const values = projection.values(entry.path, true);
|
|
131
|
+
if (Object.keys(values).length)
|
|
132
|
+
entry.values = values;
|
|
133
|
+
const known = (id) => projection.isAvailable(id, entry.path, true);
|
|
134
|
+
if (!known(definitions.functions))
|
|
135
|
+
entry.functions = null;
|
|
136
|
+
if (!known(definitions.complexity))
|
|
137
|
+
entry.complexity = null;
|
|
138
|
+
if (!entry.quality)
|
|
139
|
+
return;
|
|
140
|
+
for (const [id, field] of qualityFields)
|
|
141
|
+
if (!known(id))
|
|
142
|
+
delete entry.quality[field];
|
|
143
|
+
if (!known(definitions.duplicatedLines) || !known(definitions.codeLines))
|
|
144
|
+
delete entry.quality.duplication;
|
|
145
|
+
}
|
|
146
|
+
function addFileQuality(byPath, duplicated, findings, skipped) {
|
|
145
147
|
for (const [path, duplicatedLines] of duplicated) {
|
|
146
148
|
const entry = byPath.get(path);
|
|
147
149
|
const codeLines = entry?.quality?.codeLines;
|
|
@@ -149,7 +151,7 @@ function addFileQuality(byPath, duplicated, findings) {
|
|
|
149
151
|
continue;
|
|
150
152
|
const result = quality(entry);
|
|
151
153
|
result.duplication = { duplicatedLines, codeLines };
|
|
152
|
-
if (findings !== undefined)
|
|
154
|
+
if (findings !== undefined && !skipped.has(path))
|
|
153
155
|
result.maintainability = { smells: 0, effortMinutes: 0 };
|
|
154
156
|
}
|
|
155
157
|
for (const finding of findings ?? []) {
|
|
@@ -169,25 +171,34 @@ function emptyMetrics(path) {
|
|
|
169
171
|
function byName(left, right) {
|
|
170
172
|
return comparePaths(left.path, right.path);
|
|
171
173
|
}
|
|
172
|
-
function
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
174
|
+
function rollUpFile(directories, file) {
|
|
175
|
+
let path = file.path;
|
|
176
|
+
do {
|
|
177
|
+
path = path.slice(0, Math.max(0, path.lastIndexOf('/')));
|
|
178
|
+
let directory = directories.get(path);
|
|
179
|
+
if (!directory) {
|
|
180
|
+
directory = { ...emptyMetrics(path), files: 0, sizeMeasuredFiles: 0, coverageMeasuredFiles: 0 };
|
|
181
|
+
directories.set(path, directory);
|
|
182
|
+
}
|
|
183
|
+
directory.files++;
|
|
184
|
+
if (file.lines !== null)
|
|
185
|
+
directory.sizeMeasuredFiles++;
|
|
186
|
+
directory.lines = sumKnown(directory.lines, file.lines);
|
|
187
|
+
if (file.bytes !== undefined)
|
|
188
|
+
directory.bytes = (directory.bytes ?? 0) + file.bytes;
|
|
189
|
+
directory.functions = sumKnown(directory.functions, file.functions);
|
|
190
|
+
directory.complexity = addComplexity(directory.complexity, file.complexity);
|
|
191
|
+
if (file.lineCoverage) {
|
|
192
|
+
directory.coverageMeasuredFiles++;
|
|
193
|
+
directory.lineCoverage = {
|
|
194
|
+
covered: (directory.lineCoverage?.covered ?? 0) + file.lineCoverage.covered,
|
|
195
|
+
total: (directory.lineCoverage?.total ?? 0) + file.lineCoverage.total,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
directory.diagnosticCount += file.diagnosticCount;
|
|
199
|
+
if (file.quality)
|
|
200
|
+
addQuality(quality(directory), file.quality);
|
|
201
|
+
} while (path !== '');
|
|
191
202
|
}
|
|
192
203
|
function quality(entry) {
|
|
193
204
|
return entry.quality ??= {};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { javascriptType, typescriptType } from '../../../core/model/file-types.js';
|
|
2
|
+
import { isRecord } from '../../../core/model/plugin-data.js';
|
|
3
|
+
import { legacySyntaxPlugin } from '../../../core/model/report.js';
|
|
1
4
|
import { canonicalMetricId, definitions } from '../../../core/model/measurement.js';
|
|
2
5
|
import { lcovLines } from '../../../core/model/line-coverage.js';
|
|
3
6
|
import { comparePaths } from '../../../core/model/snapshot.js';
|
|
4
7
|
import { fileMetrics } from './file-metrics.js';
|
|
5
8
|
import { inspectionContext } from './inspection-context.js';
|
|
9
|
+
import { isLanguageDisplay } from '../../../core/model/language.js';
|
|
6
10
|
import { componentFiles } from './components.js';
|
|
7
11
|
export function inspectionAsset(report, options) {
|
|
8
12
|
return { schema: 'urn:repometry:schema:viewer-inspection:1', sha: report.subject.id,
|
|
@@ -25,34 +29,49 @@ export function inspectionDetails(report, { components = [], languages } = {}) {
|
|
|
25
29
|
}
|
|
26
30
|
/** The applied configuration, field by field; whatever is missing or malformed is left out rather than guessed. */
|
|
27
31
|
export function profileSettings(applied) {
|
|
28
|
-
if (!
|
|
32
|
+
if (!isRecord(applied))
|
|
29
33
|
return undefined;
|
|
30
|
-
const source =
|
|
31
|
-
const maintainability =
|
|
32
|
-
const rules =
|
|
34
|
+
const source = isRecord(applied.source) ? applied.source : {};
|
|
35
|
+
const maintainability = isRecord(applied.maintainability) ? applied.maintainability : {};
|
|
36
|
+
const rules = isRecord(maintainability.structuralRules) ? Object.entries(maintainability.structuralRules).flatMap(([rule, value]) => isRecord(value) && finite(value.limit) && finite(value.minutesPerExcess)
|
|
33
37
|
? [{ plugin: 'maintainability', rule, limit: value.limit, minutesPerExcess: value.minutesPerExcess }] : []) : [];
|
|
34
38
|
const duplication = maintainability.duplication;
|
|
35
39
|
const model = maintainability.debtModel;
|
|
36
40
|
const churn = applied.churn;
|
|
41
|
+
const plugins = Array.isArray(applied.plugins) ? applied.plugins.filter(isRecord) : [];
|
|
42
|
+
const languages = profileLanguages(plugins, new Set(strings(source.extensions)));
|
|
37
43
|
return {
|
|
38
44
|
id: typeof applied.profile === 'string' ? applied.profile : null,
|
|
39
|
-
|
|
45
|
+
...(languages.length ? { languages } : {}),
|
|
40
46
|
excludedPaths: [...new Set([...strings(source.defaultExclusions), ...strings(source.excludedPaths), ...strings(source.generatedExcluded)])],
|
|
41
47
|
excludedDirectories: strings(source.excludedDirectories),
|
|
42
48
|
rules,
|
|
43
|
-
duplication:
|
|
49
|
+
duplication: isRecord(duplication) && finite(duplication.minCodeLines) && finite(duplication.minNodes) && finite(duplication.minutesPerRepeatedLine)
|
|
44
50
|
? { minCodeLines: duplication.minCodeLines, minNodes: duplication.minNodes, minutesPerRepeatedLine: duplication.minutesPerRepeatedLine } : null,
|
|
45
|
-
debtModel:
|
|
51
|
+
debtModel: isRecord(model) && typeof model.name === 'string' && finite(model.scale) && finite(model.exponent) && finite(model.minutesPerPersonMonth)
|
|
46
52
|
? { name: model.name, scale: model.scale, exponent: model.exponent, minutesPerPersonMonth: model.minutesPerPersonMonth } : null,
|
|
47
|
-
churn:
|
|
48
|
-
ignore: Array.isArray(applied.findingIgnore) ? applied.findingIgnore.flatMap(entry =>
|
|
49
|
-
analyzers:
|
|
50
|
-
? [{ id
|
|
51
|
-
? Object.fromEntries(Object.entries(
|
|
53
|
+
churn: isRecord(churn) && finite(churn.lookbackDays) && finite(churn.maxCommits) ? { lookbackDays: churn.lookbackDays, maxCommits: churn.maxCommits } : null,
|
|
54
|
+
ignore: Array.isArray(applied.findingIgnore) ? applied.findingIgnore.flatMap(entry => isRecord(entry) ? [Object.fromEntries(['tool', 'rule', 'path', 'reason'].flatMap(key => typeof entry[key] === 'string' ? [[key, entry[key]]] : []))] : []) : [],
|
|
55
|
+
analyzers: plugins.flatMap(({ id, version, tools }) => typeof id === 'string' && typeof version === 'string'
|
|
56
|
+
? [{ id, version, tools: isRecord(tools)
|
|
57
|
+
? Object.fromEntries(Object.entries(tools).filter((entry) => typeof entry[1] === 'string')) : {} }] : []),
|
|
52
58
|
};
|
|
53
59
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
60
|
+
function profileLanguages(plugins, recordedExtensions) {
|
|
61
|
+
const recorded = plugins.flatMap(({ id: plugin, providesLanguages, unavailableReason }) => {
|
|
62
|
+
if (typeof plugin !== 'string' || !Array.isArray(providesLanguages))
|
|
63
|
+
return [];
|
|
64
|
+
return providesLanguages.flatMap(language => isRecord(language) && isLanguageDisplay(language)
|
|
65
|
+
? [{ plugin, id: language.id, label: language.label, extensions: strings(language.extensions), globs: strings(language.globs),
|
|
66
|
+
...(typeof unavailableReason === 'string' ? { unavailableReason } : {}) }]
|
|
67
|
+
: []);
|
|
68
|
+
});
|
|
69
|
+
if (recorded.length)
|
|
70
|
+
return recorded;
|
|
71
|
+
return [javascriptType, typescriptType].flatMap(({ id, label, extensions }) => {
|
|
72
|
+
const selected = extensions.filter(ext => recordedExtensions.has(ext));
|
|
73
|
+
return selected.length ? [{ plugin: legacySyntaxPlugin, id, label, extensions: selected, globs: [] }] : [];
|
|
74
|
+
});
|
|
56
75
|
}
|
|
57
76
|
function finite(value) {
|
|
58
77
|
return typeof value === 'number' && Number.isFinite(value);
|
|
@@ -4,5 +4,6 @@ export declare function metricProjection(report: Report): {
|
|
|
4
4
|
catalog: MetricDescriptor[];
|
|
5
5
|
privateMetrics: string[] | undefined;
|
|
6
6
|
values: (path?: string, directory?: boolean) => MetricValues;
|
|
7
|
+
isAvailable: (id: string, path?: string, directory?: boolean) => boolean;
|
|
7
8
|
} | undefined;
|
|
8
9
|
export declare function canonicalMetricDescriptor(metric: MetricDescriptor): MetricDescriptor;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { canonicalMetricId } from '../../../core/model/measurement.js';
|
|
1
|
+
import { canonicalMetricId, definitions } from '../../../core/model/measurement.js';
|
|
2
|
+
const structureMetricIds = {
|
|
3
|
+
functions: definitions.functions, cyclomaticComplexity: definitions.complexity,
|
|
4
|
+
cognitiveComplexity: definitions.cognitiveComplexity, classes: definitions.classes,
|
|
5
|
+
commentLines: definitions.comments, codeLines: definitions.codeLines, duplication: definitions.duplicatedLines,
|
|
6
|
+
};
|
|
2
7
|
export function metricProjection(report) {
|
|
3
8
|
const metadata = report.pluginData;
|
|
4
9
|
if (!metadata?.metrics.length)
|
|
@@ -16,6 +21,31 @@ export function metricProjection(report) {
|
|
|
16
21
|
else
|
|
17
22
|
rows.set(id, [row]);
|
|
18
23
|
}
|
|
24
|
+
const unavailable = new Map();
|
|
25
|
+
for (const { path, unmeasured } of metadata.inventory ?? []) {
|
|
26
|
+
for (const measure of unmeasured ?? []) {
|
|
27
|
+
const id = structureMetricIds[measure];
|
|
28
|
+
if (id === undefined)
|
|
29
|
+
continue;
|
|
30
|
+
let files = unavailable.get(id);
|
|
31
|
+
if (!files)
|
|
32
|
+
unavailable.set(id, files = new Set());
|
|
33
|
+
files.add(path);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function isAvailable(id, path, directory = false) {
|
|
37
|
+
const files = unavailable.get(id);
|
|
38
|
+
if (!files)
|
|
39
|
+
return true;
|
|
40
|
+
if (path === undefined || (directory && path === ''))
|
|
41
|
+
return false;
|
|
42
|
+
if (!directory)
|
|
43
|
+
return !files.has(path);
|
|
44
|
+
for (const file of files)
|
|
45
|
+
if (file.startsWith(path + '/'))
|
|
46
|
+
return false;
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
19
49
|
function values(path, directory = false) {
|
|
20
50
|
const result = {};
|
|
21
51
|
for (const [index, metric] of metrics.entries()) {
|
|
@@ -23,7 +53,10 @@ export function metricProjection(report) {
|
|
|
23
53
|
continue;
|
|
24
54
|
const rowValues = (id) => rows.get(id) ?? [];
|
|
25
55
|
let value;
|
|
26
|
-
if (metric.
|
|
56
|
+
if (!isAvailable(metric.id, path, directory)) {
|
|
57
|
+
value = null;
|
|
58
|
+
}
|
|
59
|
+
else if (metric.ratio) {
|
|
27
60
|
const numerator = rollup(rowValues(metric.ratio.of), 'sum', path, directory);
|
|
28
61
|
const denominator = rollup(rowValues(metric.ratio.over), 'sum', path, directory);
|
|
29
62
|
value = denominator && numerator !== null ? numerator / denominator : null;
|
|
@@ -37,7 +70,7 @@ export function metricProjection(report) {
|
|
|
37
70
|
return result;
|
|
38
71
|
}
|
|
39
72
|
const privateMetrics = metadata.privateMetrics?.map(canonicalMetricId).filter(id => measured.has(id));
|
|
40
|
-
return { catalog: metrics, privateMetrics: privateMetrics?.length ? privateMetrics : undefined, values };
|
|
73
|
+
return { catalog: metrics, privateMetrics: privateMetrics?.length ? privateMetrics : undefined, values, isAvailable };
|
|
41
74
|
}
|
|
42
75
|
export function canonicalMetricDescriptor(metric) {
|
|
43
76
|
const id = canonicalMetricId(metric.id);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { lstat, mkdir } from 'node:fs/promises';
|
|
2
|
+
export function hasCode(error, code) {
|
|
3
|
+
return error instanceof Error && 'code' in error && error.code === code;
|
|
4
|
+
}
|
|
5
|
+
export async function ensureDirectory(path) {
|
|
6
|
+
try {
|
|
7
|
+
await mkdir(path, { mode: 0o700 });
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
if (!hasCode(error, 'EEXIST'))
|
|
11
|
+
throw error;
|
|
12
|
+
}
|
|
13
|
+
await checkDirectory(path);
|
|
14
|
+
}
|
|
15
|
+
export async function checkDirectory(path) {
|
|
16
|
+
if (!(await lstat(path)).isDirectory())
|
|
17
|
+
throw new Error(`Expected a directory: ${path}`);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=directory.js.map
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import type { Subject } from '../../../core/model/snapshot.js';
|
|
2
2
|
import type { CommitSummary } from '../wire/summary-model.js';
|
|
3
3
|
import type { Report, ReportStore } from '../validation/report.js';
|
|
4
|
+
import { LocalObjectStore } from './object-store.js';
|
|
4
5
|
export declare class LocalReportStore implements ReportStore {
|
|
5
6
|
private readonly directory;
|
|
7
|
+
readonly objects: LocalObjectStore;
|
|
8
|
+
private readonly cache;
|
|
6
9
|
constructor(directory: string);
|
|
7
|
-
save(report: Report
|
|
10
|
+
save(report: Report, { deferSummary }?: {
|
|
11
|
+
deferSummary?: boolean | undefined;
|
|
12
|
+
}): Promise<void>;
|
|
8
13
|
read(subject: Subject): Promise<Report>;
|
|
9
14
|
list(): Promise<readonly Report[]>;
|
|
15
|
+
/** Saved subjects by folder name, whether or not their report is published yet. */
|
|
16
|
+
subjects(): Promise<readonly Subject[]>;
|
|
17
|
+
/** The saved report file of a subject. */
|
|
18
|
+
text(subject: Subject): Promise<string>;
|
|
10
19
|
listSummaries(): Promise<readonly CommitSummary[]>;
|
|
11
|
-
|
|
20
|
+
refreshSummary(): Promise<void>;
|
|
21
|
+
private readWith;
|
|
12
22
|
private folder;
|
|
13
23
|
}
|
|
24
|
+
/** The summary row a saved report keeps on its first line, unless it has none or it needs recalculating. */
|
|
25
|
+
export declare function headerSummary(text: string, sha: string): CommitSummary | undefined;
|
|
@@ -2,49 +2,71 @@ import { lstat, mkdir, open, readFile, readdir } from 'node:fs/promises';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { isDeepStrictEqual } from 'node:util';
|
|
4
4
|
import { isRecord } from '../../../core/engine/plugin.js';
|
|
5
|
-
import { commitSummary, orderSummaries, repositorySummary } from '../projections/commit-summary.js';
|
|
5
|
+
import { commitSummary, needsMaintainabilityRefresh, orderSummaries, repositorySummary } from '../projections/commit-summary.js';
|
|
6
6
|
import { summarySchema } from '../wire/summary-model.js';
|
|
7
|
-
import { compactJsonSchema
|
|
8
|
-
import { compareReports, readReport,
|
|
7
|
+
import { compactJsonSchema } from '../wire/compact-json.js';
|
|
8
|
+
import { compareReports, readReport, readStoredReport, validSubjectId } from '../validation/report.js';
|
|
9
9
|
import { validateSummaryRow } from '../validation/summary-validation.js';
|
|
10
|
+
import { checkDirectory, ensureDirectory, hasCode } from './directory.js';
|
|
11
|
+
import { LocalObjectStore } from './object-store.js';
|
|
10
12
|
import { replaceFile } from './replace-file.js';
|
|
11
|
-
|
|
13
|
+
import { ObjectCache, rebuildReport, splitReport, storedReportSchema } from './report-tree.js';
|
|
14
|
+
const headerStart = `{"schema":"${storedReportSchema}"`;
|
|
15
|
+
// Reports saved before objects carried the same summary header under the compact JSON schema.
|
|
16
|
+
const summaryHeaders = [headerStart, `{"schema":"${compactJsonSchema}"`].map(start => `${start},"summary":`);
|
|
12
17
|
export class LocalReportStore {
|
|
13
18
|
directory;
|
|
19
|
+
objects;
|
|
20
|
+
cache = new ObjectCache();
|
|
14
21
|
constructor(directory) {
|
|
15
22
|
this.directory = directory;
|
|
23
|
+
this.objects = new LocalObjectStore(directory);
|
|
16
24
|
}
|
|
17
|
-
async save(report) {
|
|
25
|
+
async save(report, { deferSummary = false } = {}) {
|
|
18
26
|
readReport(report);
|
|
19
27
|
const base = join(this.directory, subjectFolder(report.subject.kind));
|
|
20
28
|
const folder = this.folder(report.subject);
|
|
21
29
|
await mkdir(this.directory, { mode: 0o700, recursive: true });
|
|
22
30
|
await ensureDirectory(base);
|
|
23
31
|
await ensureDirectory(folder);
|
|
24
|
-
const
|
|
25
|
-
const {
|
|
32
|
+
const value = JSON.parse(JSON.stringify(report));
|
|
33
|
+
const { stored, objects } = splitReport(value);
|
|
34
|
+
const saved = { read: async (ids) => ids.map(id => JSON.parse(objects.get(id))) };
|
|
35
|
+
if (JSON.stringify(await rebuildReport(stored, saved)) !== JSON.stringify(value)) {
|
|
36
|
+
throw new Error(`The store cannot keep report ${report.subject.id} exactly`);
|
|
37
|
+
}
|
|
26
38
|
const row = report.subject.kind === 'commit' ? commitSummary(report) : undefined;
|
|
27
39
|
if (row && !validateSummaryRow(row))
|
|
28
40
|
throw new Error(`Invalid report summary: ${report.subject.id}`);
|
|
41
|
+
// Objects go first, so a published commit file never names a missing object.
|
|
42
|
+
await this.objects.write(objects);
|
|
29
43
|
// Keep the small index row on the first line of the same atomic file as the report.
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
await replaceFile(folder, 'report.json', contents);
|
|
34
|
-
if (report.subject.kind === 'commit')
|
|
44
|
+
const body = JSON.stringify(stored).slice(1);
|
|
45
|
+
await replaceFile(folder, 'report.json', row ? `${headerStart},"summary":${JSON.stringify(row)},\n${body}\n` : `${headerStart},${body}\n`);
|
|
46
|
+
if (report.subject.kind === 'commit' && !deferSummary)
|
|
35
47
|
await this.refreshSummary();
|
|
36
48
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const path = join(folder, 'report.json');
|
|
40
|
-
await checkDirectory(join(this.directory, subjectFolder(subject.kind)));
|
|
41
|
-
await checkDirectory(folder);
|
|
42
|
-
if (!(await lstat(path)).isFile())
|
|
43
|
-
throw new Error(`Expected a report file: ${path}`);
|
|
44
|
-
return readReportText(await readFile(path, 'utf8'), subject);
|
|
49
|
+
read(subject) {
|
|
50
|
+
return this.readWith(subject, this.objects.source(this.cache));
|
|
45
51
|
}
|
|
46
52
|
async list() {
|
|
53
|
+
const objects = this.objects.source(this.cache);
|
|
47
54
|
const reports = [];
|
|
55
|
+
for (const subject of await this.subjects()) {
|
|
56
|
+
try {
|
|
57
|
+
reports.push(await this.readWith(subject, objects));
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
// A writer may have created the directory but not published its report yet.
|
|
61
|
+
if (!hasCode(error, 'ENOENT'))
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return reports.sort(compareReports);
|
|
66
|
+
}
|
|
67
|
+
/** Saved subjects by folder name, whether or not their report is published yet. */
|
|
68
|
+
async subjects() {
|
|
69
|
+
const subjects = [];
|
|
48
70
|
for (const kind of ['commit', 'working-tree']) {
|
|
49
71
|
const base = join(this.directory, subjectFolder(kind));
|
|
50
72
|
try {
|
|
@@ -56,19 +78,21 @@ export class LocalReportStore {
|
|
|
56
78
|
throw error;
|
|
57
79
|
}
|
|
58
80
|
for (const entry of await readdir(base, { withFileTypes: true })) {
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
reports.push(await this.read({ kind, id: entry.name }));
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
// A writer may have created the directory but not published its report yet.
|
|
66
|
-
if (!hasCode(error, 'ENOENT'))
|
|
67
|
-
throw error;
|
|
68
|
-
}
|
|
81
|
+
if (entry.isDirectory() && validSubjectId(kind, entry.name))
|
|
82
|
+
subjects.push({ kind, id: entry.name });
|
|
69
83
|
}
|
|
70
84
|
}
|
|
71
|
-
return
|
|
85
|
+
return subjects;
|
|
86
|
+
}
|
|
87
|
+
/** The saved report file of a subject. */
|
|
88
|
+
async text(subject) {
|
|
89
|
+
const folder = this.folder(subject);
|
|
90
|
+
const path = join(folder, 'report.json');
|
|
91
|
+
await checkDirectory(join(this.directory, subjectFolder(subject.kind)));
|
|
92
|
+
await checkDirectory(folder);
|
|
93
|
+
if (!(await lstat(path)).isFile())
|
|
94
|
+
throw new Error(`Expected a report file: ${path}`);
|
|
95
|
+
return readFile(path, 'utf8');
|
|
72
96
|
}
|
|
73
97
|
async listSummaries() {
|
|
74
98
|
const base = join(this.directory, 'commits');
|
|
@@ -120,6 +144,9 @@ export class LocalReportStore {
|
|
|
120
144
|
}
|
|
121
145
|
throw new Error('Reports kept changing during summary publication. The inspection is saved and the summary can be refreshed by retrying.');
|
|
122
146
|
}
|
|
147
|
+
async readWith(subject, objects) {
|
|
148
|
+
return readStoredReport(await this.text(subject), subject, objects);
|
|
149
|
+
}
|
|
123
150
|
folder(subject) {
|
|
124
151
|
if (!validSubjectId(subject.kind, subject.id))
|
|
125
152
|
throw new Error(`Invalid ${subject.kind} ID: ${subject.id}`);
|
|
@@ -129,42 +156,29 @@ export class LocalReportStore {
|
|
|
129
156
|
async function readSummaryHeader(path, sha) {
|
|
130
157
|
const file = await open(path, 'r');
|
|
131
158
|
try {
|
|
132
|
-
const buffer = Buffer.alloc(
|
|
159
|
+
const buffer = Buffer.alloc(64 * 1024);
|
|
133
160
|
const { bytesRead } = await file.read(buffer, 0, buffer.length, 0);
|
|
134
|
-
|
|
135
|
-
if (end < 0)
|
|
136
|
-
return undefined;
|
|
137
|
-
const first = buffer.toString('utf8', 0, end);
|
|
138
|
-
if (!first.startsWith(packedHeader) || !first.endsWith(','))
|
|
139
|
-
return undefined;
|
|
140
|
-
const envelope = JSON.parse(first.slice(0, -1) + '}');
|
|
141
|
-
if (!isRecord(envelope) || !validateSummaryRow(envelope.summary) || envelope.summary.sha !== sha
|
|
142
|
-
|| !envelope.summary.revision || envelope.summary.detail !== undefined)
|
|
143
|
-
throw new Error(`Invalid report summary: ${sha}`);
|
|
144
|
-
return envelope.summary;
|
|
161
|
+
return headerSummary(buffer.toString('utf8', 0, bytesRead), sha);
|
|
145
162
|
}
|
|
146
163
|
finally {
|
|
147
164
|
await file.close();
|
|
148
165
|
}
|
|
149
166
|
}
|
|
167
|
+
/** The summary row a saved report keeps on its first line, unless it has none or it needs recalculating. */
|
|
168
|
+
export function headerSummary(text, sha) {
|
|
169
|
+
const end = text.indexOf('\n');
|
|
170
|
+
if (end < 0)
|
|
171
|
+
return undefined;
|
|
172
|
+
const first = text.slice(0, end);
|
|
173
|
+
if (!summaryHeaders.some(start => first.startsWith(start)) || !first.endsWith(','))
|
|
174
|
+
return undefined;
|
|
175
|
+
const envelope = JSON.parse(first.slice(0, -1) + '}');
|
|
176
|
+
if (!isRecord(envelope) || !validateSummaryRow(envelope.summary) || envelope.summary.sha !== sha
|
|
177
|
+
|| !envelope.summary.revision || envelope.summary.detail !== undefined)
|
|
178
|
+
throw new Error(`Invalid report summary: ${sha}`);
|
|
179
|
+
return needsMaintainabilityRefresh(envelope.summary) ? undefined : envelope.summary;
|
|
180
|
+
}
|
|
150
181
|
function subjectFolder(kind) {
|
|
151
182
|
return kind === 'commit' ? 'commits' : 'working-trees';
|
|
152
183
|
}
|
|
153
|
-
function hasCode(error, code) {
|
|
154
|
-
return error instanceof Error && 'code' in error && error.code === code;
|
|
155
|
-
}
|
|
156
|
-
async function ensureDirectory(path) {
|
|
157
|
-
try {
|
|
158
|
-
await mkdir(path, { mode: 0o700 });
|
|
159
|
-
}
|
|
160
|
-
catch (error) {
|
|
161
|
-
if (!hasCode(error, 'EEXIST'))
|
|
162
|
-
throw error;
|
|
163
|
-
}
|
|
164
|
-
await checkDirectory(path);
|
|
165
|
-
}
|
|
166
|
-
async function checkDirectory(path) {
|
|
167
|
-
if (!(await lstat(path)).isDirectory())
|
|
168
|
-
throw new Error(`Expected a directory: ${path}`);
|
|
169
|
-
}
|
|
170
184
|
//# sourceMappingURL=local-store.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ObjectCache } from './report-tree.js';
|
|
2
|
+
import type { ObjectSource } from './report-tree.js';
|
|
3
|
+
/** Content-addressed report objects under `<store>/objects`. Objects are immutable: a valid one is never rewritten. */
|
|
4
|
+
export declare class LocalObjectStore {
|
|
5
|
+
private readonly directory;
|
|
6
|
+
constructor(directory: string);
|
|
7
|
+
source(cache?: ObjectCache): ObjectSource;
|
|
8
|
+
/** Writes each object that is missing or fails its check. */
|
|
9
|
+
write(objects: ReadonlyMap<string, string>): Promise<void>;
|
|
10
|
+
valid(id: string): Promise<boolean>;
|
|
11
|
+
bytes(id: string): Promise<Buffer | undefined>;
|
|
12
|
+
ids(): Promise<readonly string[]>;
|
|
13
|
+
remove(id: string): Promise<void>;
|
|
14
|
+
}
|