@vltpkg/registry-client 1.0.5 → 1.0.6
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/dist/cache-entry.d.ts +1 -1
- package/dist/cache-entry.js +2 -1
- package/dist/cache-revalidate.js +1 -1
- package/dist/index.js +3 -1
- package/package.json +9 -9
package/dist/cache-entry.d.ts
CHANGED
|
@@ -145,7 +145,7 @@ export declare class CacheEntry {
|
|
|
145
145
|
* and this static method will decode it into a CacheEntry representing
|
|
146
146
|
* the cached response.
|
|
147
147
|
*/
|
|
148
|
-
static decode(buffer: Uint8Array): CacheEntry;
|
|
148
|
+
static decode(buffer: Uint8Array, options?: CacheEntryOptions): CacheEntry;
|
|
149
149
|
static isGzipEntry(buffer: Uint8Array): boolean;
|
|
150
150
|
/**
|
|
151
151
|
* Encode status + headers (no body) as they appear at the start of
|
package/dist/cache-entry.js
CHANGED
|
@@ -500,7 +500,7 @@ export class CacheEntry {
|
|
|
500
500
|
* and this static method will decode it into a CacheEntry representing
|
|
501
501
|
* the cached response.
|
|
502
502
|
*/
|
|
503
|
-
static decode(buffer) {
|
|
503
|
+
static decode(buffer, options = {}) {
|
|
504
504
|
const parsed = CacheEntry.#parseHead(buffer);
|
|
505
505
|
if (!parsed)
|
|
506
506
|
return emptyCacheEntry;
|
|
@@ -510,6 +510,7 @@ export class CacheEntry {
|
|
|
510
510
|
integrity: parsed.integrity,
|
|
511
511
|
trustIntegrity: true,
|
|
512
512
|
contentLength: body.byteLength,
|
|
513
|
+
...options,
|
|
513
514
|
});
|
|
514
515
|
c.#fromCache = true;
|
|
515
516
|
c.#headSize = parsed.headSize;
|
package/dist/cache-revalidate.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -217,7 +217,9 @@ export class RegistryClient {
|
|
|
217
217
|
const hit = this.#decoded.get(buffer);
|
|
218
218
|
if (hit)
|
|
219
219
|
return hit;
|
|
220
|
-
const entry = CacheEntry.decode(buffer
|
|
220
|
+
const entry = CacheEntry.decode(buffer, {
|
|
221
|
+
'stale-while-revalidate-factor': this.staleWhileRevalidateFactor,
|
|
222
|
+
});
|
|
221
223
|
// statusCode 0 == undecodable, and a cached JSON body that fails
|
|
222
224
|
// to parse is corrupt. Treat both as a total miss: the caller
|
|
223
225
|
// refetches without conditional headers, so a fresh response
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/registry-client",
|
|
3
3
|
"description": "Fetch package artifacts and metadata from registries",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.6",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"url": "http://vlt.sh"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@vltpkg/cache": "1.0.
|
|
17
|
-
"@vltpkg/cache-unzip": "1.0.
|
|
18
|
-
"@vltpkg/error-cause": "1.0.
|
|
19
|
-
"@vltpkg/keychain": "1.0.
|
|
20
|
-
"@vltpkg/output": "1.0.
|
|
21
|
-
"@vltpkg/types": "1.0.
|
|
22
|
-
"@vltpkg/url-open": "1.0.
|
|
23
|
-
"@vltpkg/xdg": "1.0.
|
|
16
|
+
"@vltpkg/cache": "1.0.6",
|
|
17
|
+
"@vltpkg/cache-unzip": "1.0.6",
|
|
18
|
+
"@vltpkg/error-cause": "1.0.6",
|
|
19
|
+
"@vltpkg/keychain": "1.0.6",
|
|
20
|
+
"@vltpkg/output": "1.0.6",
|
|
21
|
+
"@vltpkg/types": "1.0.6",
|
|
22
|
+
"@vltpkg/url-open": "1.0.6",
|
|
23
|
+
"@vltpkg/xdg": "1.0.6",
|
|
24
24
|
"cache-control-parser": "^2.0.6",
|
|
25
25
|
"package-json-from-dist": "^1.0.1",
|
|
26
26
|
"undici": "^7.16.0"
|