@foss.global/codefeed 5.2.0 → 5.4.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 +46 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.giteasourceinventory.d.ts +11 -1
- package/dist_ts/classes.giteasourceinventory.js +77 -10
- package/dist_ts/classes.giteasourcetransfer.d.ts +52 -15
- package/dist_ts/classes.giteasourcetransfer.js +93 -103
- package/dist_ts/forgeinventory.client.d.ts +21 -1
- package/dist_ts/forgeinventory.client.js +30 -5
- package/dist_ts/forgeinventory.transfer.d.ts +24 -0
- package/dist_ts/forgeinventory.transfer.js +77 -1
- package/dist_ts/forgeinventory.transport.d.ts +21 -7
- package/dist_ts/forgeinventory.transport.js +15 -10
- package/dist_ts/giteasourceinventory.packages.d.ts +49 -0
- package/dist_ts/giteasourceinventory.packages.js +180 -1
- package/dist_ts/giteasourcetransfer.documents.d.ts +50 -0
- package/dist_ts/giteasourcetransfer.documents.js +130 -0
- package/dist_ts/index.d.ts +2 -0
- package/dist_ts/index.js +2 -1
- package/package.json +3 -3
- package/readme.md +10 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.giteasourceinventory.ts +100 -14
- package/ts/classes.giteasourcetransfer.ts +145 -102
- package/ts/forgeinventory.client.ts +48 -6
- package/ts/forgeinventory.transfer.ts +88 -0
- package/ts/forgeinventory.transport.ts +33 -13
- package/ts/giteasourceinventory.packages.ts +168 -0
- package/ts/giteasourcetransfer.documents.ts +140 -0
- package/ts/index.ts +2 -0
package/changelog.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-11-13 - 5.4.0
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- accept every Swift version Gitea can key an alternate manifest by (giteasourcetransfer)
|
|
8
|
+
- `readPackageDocument(…, 'swift-manifest', { swiftVersion })` refused a segment of more than 18 digits with `swift-version-invalid`, although Gitea 28.2.0 parses a manifest's version with go-version, whose segments are 64-bit signed integers, and holds every key it parses. A segment is now accepted up to 9223372036854775807, compared by value; a larger one is still refused, as are leading zeros, a zero patch, and anything but two or three segments.
|
|
9
|
+
- Compatibility: every version 5.3.0 accepted is still accepted; only keys with 19-digit segments up to that maximum are newly read.
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- record each Swift version's manifests (giteasourceinventory)
|
|
14
|
+
- A Swift package unit now carries `manifests` on every version (`IForgeSourceSwiftManifest`s: `key`, `size`, `sha256`, sorted by key in code-unit order), exactly the manifests Gitea answers 200 for, `''` (`Package.swift`) always among them (S10 C5 ruling, Addenda 2 and 3).
|
|
15
|
+
- The inventory reads each version's source archive once, verified against its recorded size and SHA-256, takes the candidate keys from the archive's central directory (zip64 included) as Gitea 28.2.0 derives manifests: every entry, in any directory, whose base name matches `manifestPattern` and whose version `NewSemver` parses, trimmed like `TrimmedVersionString`. It asks Gitea's manifest route for each key; the 303 to the release's `Package.swift` means Gitea does not hold it. More than 64 distinct keys fail the unit with `swift-manifest-candidates-over-bound`; a Swift version with other than one file with `swift-version-files-unexpected`; an archive that is no zip archive with `swift-archive-invalid`; a failed archive read with its `package-content-*` or `http-<status>` code.
|
|
16
|
+
- New options: `maxSwiftArchiveBytes` (default 128 MiB, at most 1 GiB) bounds the archives read; a version whose recorded archive is larger records `manifests: null` and is not requested, and an archive of exactly the bound is read. `packageTransferTimeoutMs` (default 30 minutes, at most six hours) limits one archive download; `requestTimeoutMs` is its idle limit.
|
|
17
|
+
- `metrics` counts the archive GETs, their response bytes and 429 answers.
|
|
18
|
+
- Compatibility: each Swift version's archive GET counts one download of the version, the accepted read stamp (S10 ruling item 8); the inventory issues no other new request but the manifest route, which counts nothing. Results of non-Swift packages are unchanged.
|
|
19
|
+
- Dependencies: `@foss.global/interfaces` ^3.3.0, which defines `manifests`, and, for the Docker Gitea test, `@foss.global/forgefixtures` ^1.1.0, whose default seed records the manifests Gitea serves and adds a Swift release with a root and a nested alternate manifest.
|
|
20
|
+
|
|
21
|
+
### Maintenance
|
|
22
|
+
|
|
23
|
+
- The source transfer's verified package content download moves into the internal transfer module as `verifiedPackageDownload`, to be shared with the source inventory; its behaviour, limits and error codes are unchanged (forgeinventory)
|
|
24
|
+
|
|
25
|
+
## 2026-11-11 - 5.3.0
|
|
26
|
+
|
|
27
|
+
### Fixes
|
|
28
|
+
|
|
29
|
+
- return package metadata documents in a canonical form instead of the bytes Gitea served (giteasourcetransfer)
|
|
30
|
+
- Gitea 28 writes a JSON object held in a map in a new key order on every read: one unchanged crate version's sparse index line came back in 6 byte sequences over 40 reads (its `features`), and npm version documents hold maps too. The SHA-256 5.2.0 returned beside `npm-version`, `swift-release` and `cargo-index-entry` documents therefore changed from read to read, and it covered state the inventory records apart (a Cargo `yanked`, an npm `deprecated`), so a recorded digest could never match a later one (S10b ruling 2026-11-11, D1 and D2).
|
|
31
|
+
- `readPackageDocument` now returns those documents as `canonicalPackageDocument` writes them, with the SHA-256 of the canonical bytes; the served bytes are not returned. `swift-manifest` stays verbatim.
|
|
32
|
+
- Upgrade: no consumer of 5.2.0's `readPackageDocument` exists; a digest recorded from it must be read again.
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
- export `canonicalPackageDocument(kind, bytes)`, the canonical form and SHA-256 of a JSON package document, for consumers to compare their own documents with what they read (giteasourcetransfer)
|
|
37
|
+
- Decode as UTF-8 (fatal) and parse a JSON object; remove the top-level `yanked` of a Cargo index entry or `deprecated` of an npm version document; write it compact with object keys sorted by code point at every depth, arrays in order and strings and integers as `JSON.stringify` writes them. A number that is not a safe integer, or a document that is not a JSON object, rejects with `document-not-canonical`.
|
|
38
|
+
- read a Swift release's alternate manifests (giteasourcetransfer)
|
|
39
|
+
- `readPackageDocument(package, version, 'swift-manifest', { swiftVersion })` reads `Package@swift-<v>.swift` through `?swift-version=` without following a redirect and resolves `null` only on Gitea's 303 to the release's own `Package.swift`, its answer for a version it holds no manifest for. Another redirect rejects with `swift-manifest-redirect-unexpected`, another status with `http-<status>`, a version Gitea would not key a manifest by with `swift-version-invalid` before any request. `Package.swift` itself must still answer 200.
|
|
40
|
+
- read a crate's description (giteasourcetransfer)
|
|
41
|
+
- The new kind `cargo-description` returns `{"description":…}` from the crate's entry in the Cargo search (`q=<name>`, the exact name, paged, at most 200 pages of 50, then `cargo-search-over-bound`). Gitea describes only the version with the highest id there, so `max_version` must be the requested version, else `package-document-missing`.
|
|
42
|
+
- `ForgeRequestClient.requestBytesOrRedirect` returns a redirect (status and `Location`) instead of refusing it, never following it; the transports take `redirect: 'return'` for it (forgeinventory)
|
|
43
|
+
|
|
44
|
+
### Tests
|
|
45
|
+
|
|
46
|
+
- Check against @foss.global/forgefixtures ^1.0.0 on Gitea 28.2.0 that every JSON document read is canonical and recomputes to its digest, that an archive with an alternate and a nested manifest serves the alternate one and redirects for the nested one, that the crate description belongs to the latest version only, and, with the fixture's state snapshots, that the alternate manifest, redirect and search reads change nothing but the administrator token's `access_token.updated_unix`, no download count included (giteasourceinventory, giteasourcetransfer)
|
|
47
|
+
- Check the canonical form (code-point key order at every depth, arrays in order, the kind's state member only, unsafe numbers, invalid UTF-8 and non-objects), the search paging, exact name, latest-version rule and bound, and the manifest redirect rules (relative and absolute `Location`, another release, another status, the default manifest) against a local HTTPS server, and the fetch transport's redirect modes (giteasourcetransfer, forgeinventory)
|
|
48
|
+
|
|
3
49
|
## 2026-11-11 - 5.2.0
|
|
4
50
|
|
|
5
51
|
### Features
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@foss.global/codefeed',
|
|
6
|
-
version: '5.
|
|
6
|
+
version: '5.4.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=
|
|
@@ -29,8 +29,18 @@ export interface IGiteaSourceInventoryOptions {
|
|
|
29
29
|
pageSize?: number;
|
|
30
30
|
/** Pages read per listing before the listing counts as partial. */
|
|
31
31
|
maxPages?: number;
|
|
32
|
+
/** Deadline of one REST, registry or LFS batch request, and the idle limit of a Swift archive download; defaults to 60 s, at most 300 s. */
|
|
32
33
|
requestTimeoutMs?: number;
|
|
33
34
|
maxResponseBytes?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The largest Swift source archive, in bytes, that the inventory reads for
|
|
37
|
+
* the version's `manifests`; defaults to 128 MiB, at most 1 GiB. A version
|
|
38
|
+
* whose recorded archive is larger is not read and records `manifests:
|
|
39
|
+
* null`. A consumer passes the cap its own store puts on an archive.
|
|
40
|
+
*/
|
|
41
|
+
maxSwiftArchiveBytes?: number;
|
|
42
|
+
/** Wall-clock limit of one Swift archive download; defaults to 30 minutes, at most six hours. */
|
|
43
|
+
packageTransferTimeoutMs?: number;
|
|
34
44
|
}
|
|
35
45
|
/** A class of source data a run measures only when its discovery selects it. */
|
|
36
46
|
export type TGiteaSourceInventoryClass = 'packages';
|
|
@@ -76,7 +86,7 @@ export declare class GiteaSourceInventory {
|
|
|
76
86
|
constructor(optionsArg: IGiteaSourceInventoryOptions);
|
|
77
87
|
/** Validated, normalized instance root; contains no credentials or API suffix. */
|
|
78
88
|
get baseUrl(): string;
|
|
79
|
-
/** REST and LFS batch requests together. */
|
|
89
|
+
/** REST, registry and LFS batch requests and Swift archive GETs together. */
|
|
80
90
|
get metrics(): IForgeRequestMetrics;
|
|
81
91
|
/**
|
|
82
92
|
* Identifies the source and its reader and lists every owner and repository
|