@foss.global/codefeed 5.1.0 → 5.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/changelog.md +21 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.giteasourceinventory.d.ts +35 -9
- package/dist_ts/classes.giteasourceinventory.js +284 -26
- package/dist_ts/classes.giteasourcetransfer.d.ts +114 -6
- package/dist_ts/classes.giteasourcetransfer.js +326 -9
- package/dist_ts/forgeinventory.client.d.ts +22 -4
- package/dist_ts/forgeinventory.client.js +32 -13
- package/dist_ts/giteasourceinventory.packages.d.ts +46 -0
- package/dist_ts/giteasourceinventory.packages.js +139 -0
- package/dist_ts/index.d.ts +1 -0
- package/dist_ts/index.js +2 -1
- package/dist_ts/plugins.d.ts +2 -2
- package/dist_ts/plugins.js +3 -1
- package/package.json +3 -3
- package/readme.md +28 -2
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.giteasourceinventory.ts +293 -24
- package/ts/classes.giteasourcetransfer.ts +395 -8
- package/ts/forgeinventory.client.ts +63 -12
- package/ts/giteasourceinventory.packages.ts +160 -0
- package/ts/index.ts +1 -0
- package/ts/plugins.ts +2 -2
package/changelog.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-11-11 - 5.2.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- inventory packages one unit per package when the run selects the package class, with their distinct content (giteasourceinventory)
|
|
8
|
+
- `discover(signal, { classes: ['packages'] })` lists every package from `/admin/packages` as `discovery.packages`, and `units()` adds a `package` unit per package; without the class nothing changes and the package class is unread. An unknown class rejects with `invalid-options`.
|
|
9
|
+
- A package unit records an `IForgeSourcePackageInventory`: owner id, linked repository, every version and each distinct file content once with its files, from the v1 package API. Container index candidates (a file list of exactly `manifest.json`) are read by digest from the registry, checked by SHA-256 and the index or manifest-list media type (`unexpected-manifest-shape` otherwise), and record their `references`; no other manifest is read. npm packages record every served dist-tag, a derived `latest` included, and each version's deprecation; Cargo versions their yank from the sparse index.
|
|
10
|
+
- A unit is whole or failed, never truncated: a listing that does not finish, `npm-version-missing`, `cargo-index-incomplete`, `package-identity-changed` and `unit-over-bound` (over `forgeSourceInventoryUnitMaxBytes` of UTF-8 JSON) fail it.
|
|
11
|
+
- `composeGiteaSourceInventory` adds `packages` and `totals.packageContent` exactly when discovery lists packages, an empty list included; `composeGiteaPackageContent` is exported as the pure function behind the content figures. Unit kinds are dispatched exhaustively; an unknown kind fails as `unit-kind-unsupported`.
|
|
12
|
+
- Every read is a GET; reading an index counts a download of its version, an accepted read stamp (S10 ruling, Addenda 1 and 2).
|
|
13
|
+
- require @foss.global/interfaces ^3.2.1
|
|
14
|
+
- read package content for the migration (giteasourcetransfer)
|
|
15
|
+
- `readContainerManifest` returns a manifest's exact bytes and `Content-Type`, checked against its digest; `downloadContainerBlob` streams a config or layer verified by SHA-256 and size.
|
|
16
|
+
- `downloadPackageFile` streams a generic file, npm tarball, Swift archive or crate, and `readPackageDocument` returns an npm version document, Swift release metadata or `Package.swift`, or a crate version's sparse index line, with its SHA-256; both are bracketed by identity reads of the version (`package-version-identity-changed`, `http-404`). The new option `packageTransferTimeoutMs` bounds a download.
|
|
17
|
+
- `ForgeRequestClient.requestBytes` reads a body as the bytes that arrived with the declared media type (forgeinventory)
|
|
18
|
+
|
|
19
|
+
### Tests
|
|
20
|
+
|
|
21
|
+
- Check every package record field for field against @foss.global/forgefixtures ^1.0.0 on Gitea 28.2.0, the distinct content against an independent computation, every transfer read, and, with the fixture's state snapshots, that the package inventory and transfer reads change nothing but `package_version.download_count` (once per lead-file read) and the administrator token's `access_token.updated_unix` (giteasourceinventory, giteasourcetransfer)
|
|
22
|
+
- Check the package class selection, index candidates, `unexpected-manifest-shape`, `unit-over-bound`, the npm, Cargo and listing failures, composition and the pure content function against a mocked Gitea, and the package transfer's digest, size, media type and identity checks against a local HTTPS server (giteasourceinventory, giteasourcetransfer)
|
|
23
|
+
|
|
3
24
|
## 2026-11-11 - 5.1.0
|
|
4
25
|
|
|
5
26
|
### Features
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@foss.global/codefeed',
|
|
6
|
-
version: '5.
|
|
6
|
+
version: '5.2.0',
|
|
7
7
|
description: 'The @foss.global/codefeed module generates commit/activity feeds from forge providers including Gitea and GitManager.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx1QkFBdUI7SUFDN0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHVIQUF1SDtDQUNySSxDQUFBIn0=
|
|
@@ -32,6 +32,17 @@ export interface IGiteaSourceInventoryOptions {
|
|
|
32
32
|
requestTimeoutMs?: number;
|
|
33
33
|
maxResponseBytes?: number;
|
|
34
34
|
}
|
|
35
|
+
/** A class of source data a run measures only when its discovery selects it. */
|
|
36
|
+
export type TGiteaSourceInventoryClass = 'packages';
|
|
37
|
+
export interface IGiteaSourceDiscoveryOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Classes beside the instance, owners and repositories to list for
|
|
40
|
+
* measurement. `packages` lists every package, so `units` measures one unit
|
|
41
|
+
* per package; without it, discovery carries no `packages` and the package
|
|
42
|
+
* class is unread.
|
|
43
|
+
*/
|
|
44
|
+
classes?: readonly TGiteaSourceInventoryClass[];
|
|
45
|
+
}
|
|
35
46
|
export interface IGiteaSourceMeasureOptions {
|
|
36
47
|
signal?: AbortSignal;
|
|
37
48
|
/** Units measured at the same time. Requests within one unit are sequential. */
|
|
@@ -53,9 +64,10 @@ export type TGiteaSourceRepositoryLookup = {
|
|
|
53
64
|
export declare const giteaSourceInventoryLimitations: readonly string[];
|
|
54
65
|
/**
|
|
55
66
|
* Authenticated, read-only inventory of a Gitea instance, read with a site
|
|
56
|
-
* administrator's token: GET requests to its REST API
|
|
57
|
-
* repository for refs, objects and LFS pointers, and
|
|
58
|
-
* requests that check which referenced objects Gitea
|
|
67
|
+
* administrator's token: GET requests to its REST API and package registries,
|
|
68
|
+
* a mirror clone of every repository for refs, objects and LFS pointers, and
|
|
69
|
+
* LFS batch `download` requests that check which referenced objects Gitea
|
|
70
|
+
* holds. It counts secrets
|
|
59
71
|
* and variables without retaining their values, and reports every read that
|
|
60
72
|
* did not finish as a partial or unmeasured value instead of a count.
|
|
61
73
|
*/
|
|
@@ -68,12 +80,18 @@ export declare class GiteaSourceInventory {
|
|
|
68
80
|
get metrics(): IForgeRequestMetrics;
|
|
69
81
|
/**
|
|
70
82
|
* Identifies the source and its reader and lists every owner and repository
|
|
71
|
-
* with its id
|
|
72
|
-
*
|
|
73
|
-
*
|
|
83
|
+
* with its id, and with `classes: ['packages']` every package from the
|
|
84
|
+
* administrator package listing (`packages`, absent otherwise). Rejects
|
|
85
|
+
* unless the token belongs to a site administrator, and rejects an unknown
|
|
86
|
+
* class with `invalid-options`; a listing that does not finish, or that
|
|
87
|
+
* lists a repository id twice, is reported in `incompleteReasons`.
|
|
88
|
+
*/
|
|
89
|
+
discover(signalArg?: AbortSignal, optionsArg?: IGiteaSourceDiscoveryOptions): Promise<IDiscovery>;
|
|
90
|
+
/**
|
|
91
|
+
* Every unit a run over this discovery measures: the instance, then owners,
|
|
92
|
+
* then repositories, then the packages discovery lists when it selected
|
|
93
|
+
* them.
|
|
74
94
|
*/
|
|
75
|
-
discover(signalArg?: AbortSignal): Promise<IDiscovery>;
|
|
76
|
-
/** Every unit a run over this discovery measures: the instance, then owners, then repositories. */
|
|
77
95
|
units(discoveryArg: IDiscovery): TUnit[];
|
|
78
96
|
/**
|
|
79
97
|
* Reads a repository by its id through `GET /repositories/{id}`, which
|
|
@@ -87,7 +105,11 @@ export declare class GiteaSourceInventory {
|
|
|
87
105
|
/**
|
|
88
106
|
* Measures one unit. Never rejects: a unit whose primary record cannot be
|
|
89
107
|
* read is `failed`, and so is a repository unit carrying an id that its name
|
|
90
|
-
* no longer answers with (`repository-identity-changed`).
|
|
108
|
+
* no longer answers with (`repository-identity-changed`). A package unit is
|
|
109
|
+
* read whole or fails, never partly: a listing that does not finish, an
|
|
110
|
+
* index that is not what its file list promises (`unexpected-manifest-shape`)
|
|
111
|
+
* and a result over `forgeSourceInventoryUnitMaxBytes` of UTF-8 JSON
|
|
112
|
+
* (`unit-over-bound`) fail it, and its record is never truncated.
|
|
91
113
|
*/
|
|
92
114
|
measureUnit(unitArg: TUnit, signalArg?: AbortSignal): Promise<TUnitResult>;
|
|
93
115
|
/**
|
|
@@ -104,6 +126,10 @@ export declare class GiteaSourceInventory {
|
|
|
104
126
|
* repositories measured with one id, owner repository counts that disagree
|
|
105
127
|
* with discovery, and every partial or unmeasured value make the inventory
|
|
106
128
|
* incomplete, with reasons aggregated per subject kind, path and reason.
|
|
129
|
+
* `packages` and `totals.packageContent` (`composeGiteaPackageContent`) are
|
|
130
|
+
* present exactly when discovery lists packages, an empty list included; a
|
|
131
|
+
* package without a record is left out, never truncated, and makes its
|
|
132
|
+
* content measures partial.
|
|
107
133
|
*/
|
|
108
134
|
export declare const composeGiteaSourceInventory: (discoveryArg: IDiscovery, resultsArg: TUnitResult[], generatorsArg: plugins.fossInterfaces.data.IForgeSourceInventoryGenerator[]) => IInventory;
|
|
109
135
|
export {};
|