@gjsify/npm-registry 0.22.0 → 0.24.1
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/lib/esm/auth.js +1 -0
- package/lib/esm/errors.js +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/integrity.js +1 -0
- package/lib/esm/npmrc.js +1 -0
- package/lib/esm/packument.js +1 -0
- package/lib/esm/retry.js +1 -0
- package/lib/esm/tarball.js +1 -0
- package/lib/esm/types.js +0 -0
- package/lib/esm/whoami.js +1 -0
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/lib/types/auth.d.ts +26 -0
- package/lib/types/errors.d.ts +23 -0
- package/lib/types/index.d.ts +9 -256
- package/lib/types/integrity.d.ts +5 -0
- package/lib/types/npmrc.d.ts +22 -0
- package/lib/types/packument.d.ts +37 -0
- package/lib/types/retry.d.ts +37 -0
- package/lib/types/tarball.d.ts +5 -0
- package/lib/types/types.d.ts +94 -0
- package/lib/types/whoami.d.ts +29 -0
- package/package.json +13 -5
package/lib/esm/auth.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";function buildHeaders(e,t){let n={"user-agent":`gjsify-install/0.24.1`,"accept-encoding":t.acceptEncoding??`identity`};if(t.npmrc){let r=resolveAuthForUrl(e,t.npmrc);r&&(n.authorization=r)}if(t.headers)for(let[e,r]of Object.entries(t.headers))n[e.toLowerCase()]=r;return n}function resolveAuthForUrl(e,t){let n=pathPrefixes(new URL(e));for(let e of n){let n=t.authTokens[e];if(n)return`Bearer ${n}`;let r=t.basicAuth[e];if(r)return`Basic ${btoa(`${r.username}:${r.password}`)}`}return null}function pathPrefixes(e){let t=e.pathname.split(`/`).filter(Boolean),n=[];for(let r=t.length;r>=0;r--){let i=t.slice(0,r).join(`/`);n.push(i?`//${e.host}/${i}`:`//${e.host}`)}return n}export{buildHeaders,resolveAuthForUrl};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";var PackageNotFoundError=class extends Error{name;url;constructor(e,t){super(`Package not found in registry: ${e} (${t})`),this.name=e,this.url=t,this.name=`PackageNotFoundError`}},IntegrityError=class extends Error{url;integrity;constructor(e,t){super(`Tarball integrity mismatch for ${e} (expected ${t})`),this.url=e,this.integrity=t,this.name=`IntegrityError`}},RegistryTimeoutError=class extends Error{url;timeoutMs;attempts;constructor(e,t,n){let r=Math.round(t/100)/10,i=Math.round(t*n/100)/10;super(`@gjsify/npm-registry: GET ${e} timed out after ${r}s × ${n} attempt(s) (total ~${i}s). This usually means the registry CDN is slow or unreachable.`),this.url=e,this.timeoutMs=t,this.attempts=n,this.name=`RegistryTimeoutError`}};export{IntegrityError,PackageNotFoundError,RegistryTimeoutError};
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{buildHeaders as e,resolveAuthForUrl as t}from"./auth.js";import{IntegrityError as n,PackageNotFoundError as r,RegistryTimeoutError as i}from"./errors.js";import{DEFAULT_REGISTRY as a,parseNpmrc as o,registryFor as s}from"./npmrc.js";import{fetchWithRetry as c}from"./retry.js";import{verifyIntegrity as l}from"./integrity.js";import{assertPackument as u,fetchPackument as d,fetchPackumentConditional as f,packumentUrl as p}from"./packument.js";import{fetchTarball as m}from"./tarball.js";import{whoami as h}from"./whoami.js";export{a as DEFAULT_REGISTRY,n as IntegrityError,r as PackageNotFoundError,i as RegistryTimeoutError,u as assertPackument,e as buildHeaders,d as fetchPackument,f as fetchPackumentConditional,m as fetchTarball,c as fetchWithRetry,p as packumentUrl,o as parseNpmrc,s as registryFor,t as resolveAuthForUrl,l as verifyIntegrity,h as whoami};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";async function verifyIntegrity(e,t){let n=t.trim().split(/\s+/);for(let t of n){let n=t.indexOf(`-`);if(n<0)continue;let r=t.slice(0,n).toLowerCase(),i=t.slice(n+1),a=globalThis.crypto?.subtle;if(!a)throw Error(`@gjsify/npm-registry: globalThis.crypto.subtle is missing`);let o=subriToWebCryptoAlgo(r);if(!o)continue;let s=await a.digest(o,dataAsArrayBuffer(e));if(bytesToBase64(new Uint8Array(s))===i)return!0}return!1}function subriToWebCryptoAlgo(e){switch(e){case`sha1`:return`SHA-1`;case`sha256`:return`SHA-256`;case`sha384`:return`SHA-384`;case`sha512`:return`SHA-512`;default:return null}}function dataAsArrayBuffer(e){if(e.byteOffset===0&&e.byteLength===e.buffer.byteLength)return e.buffer;let t=new Uint8Array(e.byteLength);return t.set(e),t.buffer}function bytesToBase64(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}export{verifyIntegrity};
|
package/lib/esm/npmrc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=`https://registry.npmjs.org/`;function registryFor(t,n){if(n&&t.startsWith(`@`)){let e=t.slice(0,t.indexOf(`/`)),r=n.scopes[e];if(r)return ensureTrailingSlash(r)}return n?.registry?ensureTrailingSlash(n.registry):e}function parseNpmrc(t){let n={registry:e,scopes:{},authTokens:{},basicAuth:{}},r=t.split(/\r?\n/),i={};for(let e of r){let t=e.replace(/^\s+|\s+$/g,``);if(!t||t.startsWith(`#`)||t.startsWith(`;`))continue;let r=t.indexOf(`=`);if(r<0)continue;let a=t.slice(0,r).trim(),o=expandEnv(stripQuotes(t.slice(r+1).trim()));if(a===`registry`){n.registry=ensureTrailingSlash(o);continue}let s=a.match(/^(@[^:]+):registry$/);if(s){n.scopes[s[1]]=ensureTrailingSlash(o);continue}let c=a.match(/^\/\/(.+):_authToken$/);if(c){n.authTokens[normalizeAuthHost(c[1])]=o;continue}let l=a.match(/^\/\/(.+):username$/);if(l){(i[normalizeAuthHost(l[1])]??={}).user=o;continue}let u=a.match(/^\/\/(.+):_password$/);if(u){let e=base64Decode(o);(i[normalizeAuthHost(u[1])]??={}).pass=e;continue}}for(let[e,t]of Object.entries(i))t.user&&t.pass!==void 0&&(n.basicAuth[e]={username:t.user,password:t.pass});return n}function normalizeAuthHost(e){return`//${e.replace(/\/+$/,``)}`}function ensureTrailingSlash(e){return e.endsWith(`/`)?e:e+`/`}function stripQuotes(e){return e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`)?e.slice(1,-1):e}function expandEnv(e){return e.replace(/\$\{([A-Z0-9_]+)\}/gi,(e,t)=>globalThis.process?.env?.[t]??``)}function base64Decode(e){return atob(e)}export{e as DEFAULT_REGISTRY,ensureTrailingSlash,parseNpmrc,registryFor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{buildHeaders as e}from"./auth.js";import{PackageNotFoundError as t}from"./errors.js";import{ensureTrailingSlash as n,registryFor as r}from"./npmrc.js";import{fetchWithRetry as i}from"./retry.js";function assertPackument(e,t){if(!t||typeof t!=`object`)throw TypeError(`registry: ${e} packument is not an object`);let n=t;if(typeof n.name!=`string`)throw TypeError(`registry: ${e} packument missing string name`);if(!n.versions||typeof n.versions!=`object`)throw TypeError(`registry: ${e} packument missing versions map`)}function packumentUrl(e,t){let r=n(t);if(e.startsWith(`@`)){let t=e.indexOf(`/`);if(t<0)throw TypeError(`Invalid scoped package name: ${e}`);let n=e.slice(0,t),i=e.slice(t+1);return`${r}${encodeURIComponent(n)}/${encodeURIComponent(i)}`}return`${r}${encodeURIComponent(e)}`}async function fetchPackumentConditional(n,a={}){let o=packumentUrl(n,a.registry??r(n,a.npmrc)),s=e(o,{...a,acceptEncoding:`gzip`});s.accept??=`application/vnd.npm.install-v1+json`,a.ifNoneMatch&&(s[`if-none-match`]=a.ifNoneMatch);let c=await i(o,{headers:s,signal:a.signal},{fetch:a.fetch,retries:a.retries,retryDelayMs:a.retryDelayMs,timeoutMs:a.timeoutMs,onRetry:a.onRetry});if(c.status===304){try{await c.arrayBuffer()}catch{}return{status:`not-modified`,etag:a.ifNoneMatch}}if(!c.ok)throw c.status===404||c.status===406?new t(n,o):Error(`registry GET ${o} -> ${c.status} ${c.statusText}`);let l=c.headers.get(`etag`)??void 0,u=await decodeJsonBody(c);return assertPackument(n,u),{status:`fresh`,packument:u,etag:l}}async function decodeJsonBody(e){return e.json()}async function fetchPackument(e,t={}){let n=await fetchPackumentConditional(e,t);if(!n.packument)throw Error(`registry: ${e} returned 304 Not Modified to an unconditional request`);return n.packument}export{assertPackument,fetchPackument,fetchPackumentConditional,packumentUrl};
|
package/lib/esm/retry.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{RegistryTimeoutError as e}from"./errors.js";async function fetchWithRetry(t,n,r){let i=r.fetch??globalThis.fetch;if(!i)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let a=Math.max(0,r.retries??3),o=Math.max(0,r.retryDelayMs??250),s=Math.max(0,r.timeoutMs??3e4),c=r.retryNotFound??!1,l=0,u,d=0;for(;;){if(n.signal?.aborted)throw signalAbortError(n.signal);let f=s>0?new AbortController:null,p=f===null?null:setTimeout(()=>f.abort(Error(`@gjsify/npm-registry: per-request timeout ${s}ms`)),s),m=composeSignals(n.signal,f?.signal);try{let e=await i(t,{...n,signal:m}),r=isRetryableStatus(e.status)||c&&e.status===404;if(e.ok||!r||l>=a)return e;try{await e.arrayBuffer()}catch{}u=Error(`HTTP ${e.status} ${e.statusText}`)}catch(r){let i=f!==null&&f.signal.aborted,o=n.signal?.aborted===!0;if(i&&!o){if(d++,l>=a)throw new e(t,s,d);u=r}else if(o)throw signalAbortError(n.signal);else{if(!isRetryableError(r)||l>=a)throw r;u=r}}finally{p!==null&&clearTimeout(p)}let h=Math.min(o*2**l,8e3);r.onRetry?.({attempt:l+1,error:u,delayMs:h}),await delay(h,n.signal),l++}}function composeSignals(e,t){return e?t?AbortSignal.any([e,t]):e:t}function isRetryableStatus(e){return e===408||e===425||e===429||e===500||e===502||e===503||e===504||e===521||e===522||e===524||e===525}function isRetryableError(e){if(e&&typeof e==`object`&&`name`in e&&e.name===`AbortError`)return!1;if(e instanceof TypeError)return!0;if(e&&typeof e==`object`&&`name`in e){let t=e.name;if(t===`FetchError`)return!0;if(t===`AbortError`)return!1}let t=e?.cause;if(t&&typeof t==`object`&&`code`in t){let e=t.code;if(typeof e==`string`)return e===`ECONNRESET`||e===`ECONNREFUSED`||e===`ENETUNREACH`||e===`ENOTFOUND`||e===`ETIMEDOUT`||e===`EAI_AGAIN`||e===`UND_ERR_SOCKET`||e===`UND_ERR_CONNECT_TIMEOUT`}return!1}function delay(e,t){return e<=0?Promise.resolve():new Promise((n,r)=>{let i=setTimeout(()=>{t?.removeEventListener?.(`abort`,onAbort),n()},e),onAbort=()=>{clearTimeout(i),r(signalAbortError(t))};if(t?.aborted){clearTimeout(i),r(signalAbortError(t));return}t?.addEventListener?.(`abort`,onAbort,{once:!0})})}function signalAbortError(e){let t=e&&`reason`in e?e.reason:void 0;if(t instanceof Error)return t;let n=Error(`Aborted`);return n.name=`AbortError`,n}export{fetchWithRetry};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{buildHeaders as e}from"./auth.js";import{IntegrityError as t}from"./errors.js";import{fetchWithRetry as n}from"./retry.js";import{verifyIntegrity as r}from"./integrity.js";async function fetchTarball(i,a={}){let o=e(i,{...a,acceptEncoding:`identity`});o.accept??=`application/octet-stream`;let s=await n(i,{headers:o,signal:a.signal},{fetch:a.fetch,retries:a.retries,retryDelayMs:a.retryDelayMs,timeoutMs:a.timeoutMs,onRetry:a.onRetry,retryNotFound:a.retryNotFound??!0});if(!s.ok)throw Error(`tarball GET ${i} -> ${s.status} ${s.statusText}`);let c=new Uint8Array(await s.arrayBuffer());if(a.integrity&&!await r(c,a.integrity))throw new t(i,a.integrity);return c}export{fetchTarball};
|
package/lib/esm/types.js
ADDED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{buildHeaders as e}from"./auth.js";import{ensureTrailingSlash as t}from"./npmrc.js";async function whoami(n,r){let i=`${t(n)}-/whoami`,a=e(i,{npmrc:r});a.accept=`application/json`;let o=globalThis.fetch;if(!o)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let s=await o(i,{method:`GET`,headers:a});if(!s.ok)throw Error(`whoami GET ${i} -> ${s.status} ${s.statusText}`);let c=await s.json();if(c&&typeof c==`object`&&`username`in c){let e=c.username;if(typeof e==`string`&&e.length>0)return{username:e}}return{}}export{whoami};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../../../node_modules/@gjsify/tsc/lib/lib.es5.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2016.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2018.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2019.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2021.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2023.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.dom.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.core.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.collection.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.generator.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.iterable.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.promise.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.proxy.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.reflect.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.symbol.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2016.array.include.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2016.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.arraybuffer.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.date.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.object.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.string.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2018.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2018.promise.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2018.regexp.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2019.array.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2019.object.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2019.string.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2019.symbol.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2019.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.bigint.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.date.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.promise.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.string.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.number.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2021.promise.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2021.string.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2021.weakref.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2021.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.array.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.error.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.object.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.string.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.regexp.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2023.array.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2023.collection.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2023.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.arraybuffer.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.collection.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.object.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.promise.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.regexp.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.sharedmemory.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.string.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.collection.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.float16.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.iterator.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.promise.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.regexp.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.array.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.collection.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.date.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.decorators.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.disposable.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.error.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.sharedmemory.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.temporal.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.typedarrays.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.decorators.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.decorators.legacy.d.ts","../src/index.ts"],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":99},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":99},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":99},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":99},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":99},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":99},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":99},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":99},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":99},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":99},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":99},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":99},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":99},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":99},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":99},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":99},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":99},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":99},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":99},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":99},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":99},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":99},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":99},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":99},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":99},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":99},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":99},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":99},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":99},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":99},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":99},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":99},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":99},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":99},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":99},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":99},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":99},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":99},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":99},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":99},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":99},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":99},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":99},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":99},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":99},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":99},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":99},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":99},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":99},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":99},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":99},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":99},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":99},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":99},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":99},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":99},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":99},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":99},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":99},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":99},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":99},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":99},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":99},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":99},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":99},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":99},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":99},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":99},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":99},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":99},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":99},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":99},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":99},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":99},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":99},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":99},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":99},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":99},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":99},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":99},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":99},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":99},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":99},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":99},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":99},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":99},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":99},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":99},{"version":"78bca86431f314fd9b12bcdfc1532a82a026db380adea349446611eaac592ac3","signature":"8dbc0cc4ad2f02d53b846c2055925a22fc861a231578a1951230aa95640bd225"}],"root":[89],"options":{"allowImportingTsExtensions":false,"composite":true,"declaration":true,"declarationDir":"./types","experimentalDecorators":true,"module":99,"outDir":"./esm","rootDir":"../src","skipLibCheck":true,"strict":true,"target":99},"latestChangedDtsFile":"./types/index.d.ts","version":"6.0.3"}
|
|
1
|
+
{"fileNames":["../../../../node_modules/@gjsify/tsc/lib/lib.es5.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2016.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2018.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2019.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2021.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2023.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.dom.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.core.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.collection.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.generator.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.iterable.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.promise.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.proxy.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.reflect.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.symbol.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2016.array.include.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2016.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.arraybuffer.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.date.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.object.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.string.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2018.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2018.promise.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2018.regexp.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2019.array.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2019.object.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2019.string.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2019.symbol.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2019.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.bigint.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.date.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.promise.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.string.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2020.number.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2021.promise.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2021.string.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2021.weakref.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2021.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.array.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.error.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.object.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.string.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2022.regexp.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2023.array.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2023.collection.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2023.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.arraybuffer.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.collection.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.object.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.promise.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.regexp.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.sharedmemory.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2024.string.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.collection.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.float16.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.iterator.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.promise.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.es2025.regexp.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.array.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.collection.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.date.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.decorators.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.disposable.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.error.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.intl.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.sharedmemory.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.temporal.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.esnext.typedarrays.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.decorators.d.ts","../../../../node_modules/@gjsify/tsc/lib/lib.decorators.legacy.d.ts","../src/types.ts","../src/auth.ts","../src/errors.ts","../src/npmrc.ts","../src/retry.ts","../src/integrity.ts","../src/packument.ts","../src/tarball.ts","../src/whoami.ts","../src/index.ts"],"fileIdsList":[[89],[89,90,91,92,93,94,95,96,97],[89,90,91,92,93],[89,91],[89,90,91,93,94],[89,90,92]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":99},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":99},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":99},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":99},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":99},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":99},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":99},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":99},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":99},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":99},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":99},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":99},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":99},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":99},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":99},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":99},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":99},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":99},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":99},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":99},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":99},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":99},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":99},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":99},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":99},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":99},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":99},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":99},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":99},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":99},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":99},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":99},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":99},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":99},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":99},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":99},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":99},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":99},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":99},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":99},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":99},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":99},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":99},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":99},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":99},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":99},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":99},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":99},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":99},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":99},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":99},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":99},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":99},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":99},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":99},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":99},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":99},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":99},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":99},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":99},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":99},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":99},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":99},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":99},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":99},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":99},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":99},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":99},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":99},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":99},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":99},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":99},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":99},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":99},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":99},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":99},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":99},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":99},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":99},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":99},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":99},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":99},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":99},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":99},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":99},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":99},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":99},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":99},{"version":"fcc65c1b00601fd4253a38365dd82d52cf49bdaff58c49977dcafd02cc7b1bc3","signature":"7cd3454c60dc43b0d7cdc3bc83088ce692d4035943c63cf93750f706d6a39517"},{"version":"a3fbf0fafd69135c3e09033c11c5f7afa8cfd5cdd48c96dfd527a73ebf90c1f4","signature":"4f874f5daf3eafe4105cbfe0157be5ff34f0741d54650aaec47600714d009be2"},{"version":"f5ba66d1fe7a8cb103ee4262aa15fa3988a5505c8a08a56dd2f782ca699769c9","signature":"b309ce8c50d191e30fc3314df5d24f556bc6af1d0aab78cfa0b2e7f8d52ac107"},{"version":"a9e8884690e997f43ae050f53857d81a309ccb7d7edc3d707c2bca6225a5c212","signature":"23ef376f13c7eb6e3c3310f2386f46077b416c124947143d35bd93c0553f315d"},{"version":"fe7c2129797e9f34fe3f72291ee94bf501b776525215a629cbd10032a12e68f0","signature":"888ac3930d7f6d179e369a0e84299c135a3efb595f074d80248697625b37799c"},{"version":"2e687b0353b6ed4c2af49a1687409c895e32b0f99faca455e97206bfad7ef5d9","signature":"b0c42f874e366f8049a42baab30af08969e4c5b90f96c359ac7f8eb9eae82c59"},{"version":"72d81cb75bb9ac324e23902d1d0b4a92b314da5ea01f8803af8ef80812a47c21","signature":"043c0dfc0075329d8c72499df3929f4dba2ebe57b3373a18af48d5dea2cdddee"},{"version":"af466292c1c7e9ac85cdc2915c746418a7b70918e75e8f689e0a971d2e530c39","signature":"da8af403956b42c8ff42ca5bacea8049cc751cc65abc755d1a75412b39f5d4df"},{"version":"b1d979324fd79839e7b0be14302d42e745be43172ad6acf78cc31914e944eb63","signature":"614b920fcd2d54e364feccdbc7fdb64a57e72e30c8a3c8baf8b5250f823dc5d8"},{"version":"3aa61537bc287a10f866ea56d16268a5950113d4e80ea9b89ea199e081878a4f","signature":"e13d9b21ecec050528c7b2b31b15e08b34d07138aa3bc49cf63a2b3c8e5bb8e0"}],"root":[[89,98]],"options":{"allowImportingTsExtensions":false,"composite":true,"declaration":true,"declarationDir":"./types","emitDeclarationOnly":true,"experimentalDecorators":true,"module":99,"outDir":"./esm","rootDir":"../src","skipLibCheck":true,"strict":true,"target":99},"referencedMap":[[90,1],[98,2],[92,1],[95,3],[93,4],[96,5],[97,6]],"latestChangedDtsFile":"./types/index.d.ts","version":"6.0.3"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FetchOptions, NpmrcConfig } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Build auth + UA headers for a request URL. Pure (no I/O).
|
|
4
|
+
*
|
|
5
|
+
* `acceptEncoding` controls the `Accept-Encoding` header (default `identity`):
|
|
6
|
+
*
|
|
7
|
+
* - **Packuments** pass `'gzip'` — the JSON corpus compresses ~4× and is
|
|
8
|
+
* transparently decompressed by the fetch layer (undici auto-decompresses
|
|
9
|
+
* on Node; on GJS the `@gjsify/fetch` shared session has libsoup's
|
|
10
|
+
* `ContentDecoder` removed and `@gjsify/fetch` does its own
|
|
11
|
+
* `DecompressionStream` decode keyed off the surviving `Content-Encoding`
|
|
12
|
+
* header — so `res.json()` here still sees plain JSON on both runtimes).
|
|
13
|
+
* This bypasses the libsoup chunked-gzip decoder bug (`G_IO_ERROR_
|
|
14
|
+
* PARTIAL_INPUT` at the tail of an npm-CDN gzip stream) that the old blanket
|
|
15
|
+
* `identity` default was working around.
|
|
16
|
+
* - **Tarballs** pass `'identity'` — they are already-gzipped `.tgz`, and
|
|
17
|
+
* transport-gzip would change which bytes the SRI `verifyIntegrity` runs
|
|
18
|
+
* over (the raw response body), breaking integrity.
|
|
19
|
+
*
|
|
20
|
+
* Callers that don't care (e.g. `whoami`) get the safe `identity` default.
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildHeaders(url: string, opts: FetchOptions & {
|
|
23
|
+
acceptEncoding?: string;
|
|
24
|
+
}): Record<string, string>;
|
|
25
|
+
/** Resolve an `Authorization` header for a URL given a parsed .npmrc. */
|
|
26
|
+
export declare function resolveAuthForUrl(url: string, npmrc: NpmrcConfig): string | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class PackageNotFoundError extends Error {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly url: string;
|
|
4
|
+
constructor(name: string, url: string);
|
|
5
|
+
}
|
|
6
|
+
export declare class IntegrityError extends Error {
|
|
7
|
+
readonly url: string;
|
|
8
|
+
readonly integrity: string;
|
|
9
|
+
constructor(url: string, integrity: string);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Thrown when EVERY retry attempt against a registry URL exhausts the
|
|
13
|
+
* per-request timeout (`opts.timeoutMs`, default 30s). Replaces the
|
|
14
|
+
* inscrutable "signal is aborted without reason" the raw AbortSignal path
|
|
15
|
+
* would otherwise surface — `gjsify install` users seeing this know exactly
|
|
16
|
+
* what timed out, how long they waited, and that the CDN is the suspect.
|
|
17
|
+
*/
|
|
18
|
+
export declare class RegistryTimeoutError extends Error {
|
|
19
|
+
readonly url: string;
|
|
20
|
+
readonly timeoutMs: number;
|
|
21
|
+
readonly attempts: number;
|
|
22
|
+
constructor(url: string, timeoutMs: number, attempts: number);
|
|
23
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,256 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
basicAuth: Record<string, {
|
|
11
|
-
username: string;
|
|
12
|
-
password: string;
|
|
13
|
-
}>;
|
|
14
|
-
}
|
|
15
|
-
/** Distribution metadata for a single version. */
|
|
16
|
-
export interface PackumentDist {
|
|
17
|
-
tarball: string;
|
|
18
|
-
integrity?: string;
|
|
19
|
-
shasum?: string;
|
|
20
|
-
}
|
|
21
|
-
/** Single version record inside a packument. */
|
|
22
|
-
export interface PackumentVersion {
|
|
23
|
-
name: string;
|
|
24
|
-
version: string;
|
|
25
|
-
dist: PackumentDist;
|
|
26
|
-
dependencies?: Record<string, string>;
|
|
27
|
-
optionalDependencies?: Record<string, string>;
|
|
28
|
-
bin?: string | Record<string, string>;
|
|
29
|
-
deprecated?: string;
|
|
30
|
-
[key: string]: unknown;
|
|
31
|
-
}
|
|
32
|
-
/** Top-level packument shape returned by `GET /<pkg>`. */
|
|
33
|
-
export interface Packument {
|
|
34
|
-
name: string;
|
|
35
|
-
'dist-tags': Record<string, string>;
|
|
36
|
-
versions: Record<string, PackumentVersion>;
|
|
37
|
-
time?: Record<string, string>;
|
|
38
|
-
[key: string]: unknown;
|
|
39
|
-
}
|
|
40
|
-
export interface FetchOptions {
|
|
41
|
-
/** Override registry URL. Default: $npm_config_registry || DEFAULT_REGISTRY. */
|
|
42
|
-
registry?: string;
|
|
43
|
-
/** Pre-parsed .npmrc; if omitted, no auth is sent. */
|
|
44
|
-
npmrc?: NpmrcConfig;
|
|
45
|
-
/** Pre-built header map (overrides anything else). */
|
|
46
|
-
headers?: Record<string, string>;
|
|
47
|
-
/** AbortSignal forwarded to fetch. */
|
|
48
|
-
signal?: AbortSignal;
|
|
49
|
-
/** Custom fetch implementation; default = globalThis.fetch. */
|
|
50
|
-
fetch?: typeof fetch;
|
|
51
|
-
/**
|
|
52
|
-
* Max retry attempts on transient failures (network errors, TLS handshake
|
|
53
|
-
* resets, 5xx, 408, 429). Default 3 → up to 4 total attempts. Set to 0
|
|
54
|
-
* to disable retry.
|
|
55
|
-
*/
|
|
56
|
-
retries?: number;
|
|
57
|
-
/**
|
|
58
|
-
* Initial backoff in ms; doubles per attempt. Default 250 → 250, 500, 1000.
|
|
59
|
-
* The cap is 8s per delay so a bad spell stays bounded.
|
|
60
|
-
*/
|
|
61
|
-
retryDelayMs?: number;
|
|
62
|
-
/**
|
|
63
|
-
* Per-request timeout in ms. Default 30000 (30s). Set to 0 to disable.
|
|
64
|
-
*
|
|
65
|
-
* Guards against the reachable-but-slow registry case where TCP connect
|
|
66
|
-
* succeeds but the response body never finishes — a single packument
|
|
67
|
-
* fetch would otherwise await indefinitely with no resource cleanup,
|
|
68
|
-
* no error message, no progress (the exact shape of an observed
|
|
69
|
-
* `gjsify install` hang). A timeout fires an AbortError that the retry
|
|
70
|
-
* loop treats as transient (CDN slowdowns recover), so a slow attempt
|
|
71
|
-
* gets retried per the retries / retryDelayMs schedule. When ALL
|
|
72
|
-
* retries exhaust because of timeouts, a `RegistryTimeoutError` is
|
|
73
|
-
* thrown with a clear "timed out after Xs × N attempts" message.
|
|
74
|
-
*/
|
|
75
|
-
timeoutMs?: number;
|
|
76
|
-
/**
|
|
77
|
-
* Called once per retry with `{ attempt, error, delayMs }`. Useful for
|
|
78
|
-
* verbose-mode install logs ("retrying fetch in 500 ms…").
|
|
79
|
-
*/
|
|
80
|
-
onRetry?: (info: {
|
|
81
|
-
attempt: number;
|
|
82
|
-
error: unknown;
|
|
83
|
-
delayMs: number;
|
|
84
|
-
}) => void;
|
|
85
|
-
/**
|
|
86
|
-
* Treat HTTP 404 as a transient (retryable) failure rather than a hard
|
|
87
|
-
* "not found". Default false. Opt in for TARBALL fetches: a tarball URL
|
|
88
|
-
* already came from a successfully-resolved packument, so a 404 on the
|
|
89
|
-
* `.tgz` is a registry/CDN hiccup under load (observed on heavy parallel
|
|
90
|
-
* `@girs/*` installs — npm itself fails the same way) rather than a
|
|
91
|
-
* genuinely-missing artifact. Packument 404s must stay permanent (the
|
|
92
|
-
* package really doesn't exist), so leave this false there.
|
|
93
|
-
*/
|
|
94
|
-
retryNotFound?: boolean;
|
|
95
|
-
}
|
|
96
|
-
/** Strict-validate a packument shape. Throws on schema mismatch. */
|
|
97
|
-
export declare function assertPackument(name: string, body: unknown): asserts body is Packument;
|
|
98
|
-
/** Pick the right registry URL for a package name (scoped overrides win). */
|
|
99
|
-
export declare function registryFor(name: string, npmrc: NpmrcConfig | undefined): string;
|
|
100
|
-
/** Build the GET URL for a packument. Handles `@scope/name` URL-encoding. */
|
|
101
|
-
export declare function packumentUrl(name: string, registry: string): string;
|
|
102
|
-
/** Outcome of a conditional packument fetch ({@link fetchPackumentConditional}). */
|
|
103
|
-
export interface ConditionalPackument {
|
|
104
|
-
/** `'fresh'` — the registry returned a new body (200). `'not-modified'` —
|
|
105
|
-
* a 304, so the caller's cached copy is still current. */
|
|
106
|
-
status: 'fresh' | 'not-modified';
|
|
107
|
-
/** Parsed packument. Present iff `status === 'fresh'`. */
|
|
108
|
-
packument?: Packument;
|
|
109
|
-
/** The response `ETag`, to store alongside a freshly-fetched body. On a
|
|
110
|
-
* 304 this echoes back the `ifNoneMatch` the caller sent (still current). */
|
|
111
|
-
etag?: string;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Conditional packument fetch with ETag revalidation.
|
|
115
|
-
*
|
|
116
|
-
* When `ifNoneMatch` is supplied it is sent as `If-None-Match`; a `304 Not
|
|
117
|
-
* Modified` resolves to `{ status: 'not-modified' }` (no body transferred — the
|
|
118
|
-
* caller reuses its cached packument), and a `200` resolves to `{ status:
|
|
119
|
-
* 'fresh', packument, etag }`. Without `ifNoneMatch` it behaves like
|
|
120
|
-
* {@link fetchPackument} but additionally surfaces the response ETag so the
|
|
121
|
-
* caller can seed a cache.
|
|
122
|
-
*
|
|
123
|
-
* Why revalidation rather than a TTL: packuments are mutable (new versions
|
|
124
|
-
* publish over time), so a TTL cache would serve stale data and silently miss
|
|
125
|
-
* a just-published version; a conditional GET keeps a cheap round-trip but
|
|
126
|
-
* skips the (60–98 KB, `accept-encoding: identity`) body when nothing changed.
|
|
127
|
-
* Reference: npm's make-fetch-happen HTTP-cache layer.
|
|
128
|
-
*/
|
|
129
|
-
export declare function fetchPackumentConditional(name: string, opts?: FetchOptions & {
|
|
130
|
-
ifNoneMatch?: string;
|
|
131
|
-
}): Promise<ConditionalPackument>;
|
|
132
|
-
/** Fetch + parse a packument. Retries on transient errors (see fetchWithRetry). */
|
|
133
|
-
export declare function fetchPackument(name: string, opts?: FetchOptions): Promise<Packument>;
|
|
134
|
-
/** Download a tarball as bytes. Verifies SRI `integrity` when supplied. */
|
|
135
|
-
export declare function fetchTarball(url: string, opts?: FetchOptions & {
|
|
136
|
-
integrity?: string;
|
|
137
|
-
}): Promise<Uint8Array>;
|
|
138
|
-
/**
|
|
139
|
-
* Wrap a single GET in exponential-backoff retry for transient failures.
|
|
140
|
-
*
|
|
141
|
-
* Retries on:
|
|
142
|
-
* - network-layer errors thrown by `fetch` (TypeError "fetch failed",
|
|
143
|
-
* `Gio.TlsError` from Soup-backed GJS fetch when the registry CDN drops
|
|
144
|
-
* the TLS handshake mid-stream, ECONNRESET, ENETUNREACH, …)
|
|
145
|
-
* - HTTP 408 (Request Timeout), 425 (Too Early), 429 (rate limit),
|
|
146
|
-
* 500-503, 504, 522, 524 (Cloudflare upstream)
|
|
147
|
-
* - per-request timeout (opts.timeoutMs, default 30s) — the AbortError
|
|
148
|
-
* surfaced by a fired timeout signal is treated as transient (slow
|
|
149
|
-
* CDN) and retried like any other network blip; distinguished from
|
|
150
|
-
* a caller-triggered abort via the abort signal's `reason` identity.
|
|
151
|
-
*
|
|
152
|
-
* Does NOT retry on:
|
|
153
|
-
* - 4xx other than 408/425/429 (semantic errors — 404 surfaces via the
|
|
154
|
-
* caller's PackageNotFoundError path) UNLESS `opts.retryNotFound` is set,
|
|
155
|
-
* which `fetchTarball` enables so a transient CDN 404 on a `.tgz` (whose
|
|
156
|
-
* URL already came from a resolved packument) is retried like any blip
|
|
157
|
-
* - AbortError from the CALLER's signal (`opts.signal` — caller wants out)
|
|
158
|
-
* - any other thrown shape that doesn't look transient
|
|
159
|
-
*
|
|
160
|
-
* Default schedule: 250ms, 500ms, 1000ms (3 retries → 4 total attempts);
|
|
161
|
-
* capped at 8s per delay. Caller can tune via opts.retries / opts.retryDelayMs
|
|
162
|
-
* / opts.timeoutMs.
|
|
163
|
-
*
|
|
164
|
-
* When ALL retries exhaust because of per-request timeouts, throws a
|
|
165
|
-
* typed `RegistryTimeoutError` (not the raw "signal is aborted without
|
|
166
|
-
* reason" the underlying fetch would surface) so the user gets a clear
|
|
167
|
-
* "<url> timed out after Xs × N attempts" message.
|
|
168
|
-
*/
|
|
169
|
-
export declare function fetchWithRetry(url: string, init: {
|
|
170
|
-
headers: Record<string, string>;
|
|
171
|
-
signal?: AbortSignal;
|
|
172
|
-
compress?: boolean;
|
|
173
|
-
}, opts: Pick<FetchOptions, 'fetch' | 'retries' | 'retryDelayMs' | 'timeoutMs' | 'onRetry' | 'retryNotFound'>): Promise<Response>;
|
|
174
|
-
/**
|
|
175
|
-
* Verify an SRI string (e.g. `sha512-base64==`) against bytes.
|
|
176
|
-
* Multiple hashes (space-separated) accepted; any match passes.
|
|
177
|
-
*/
|
|
178
|
-
export declare function verifyIntegrity(data: Uint8Array, integrity: string): Promise<boolean>;
|
|
179
|
-
/** Parse a `.npmrc` text body. Unknown keys are kept on the result for callers. */
|
|
180
|
-
export declare function parseNpmrc(text: string): NpmrcConfig;
|
|
181
|
-
/**
|
|
182
|
-
* Build auth + UA headers for a request URL. Pure (no I/O).
|
|
183
|
-
*
|
|
184
|
-
* `acceptEncoding` controls the `Accept-Encoding` header (default `identity`):
|
|
185
|
-
*
|
|
186
|
-
* - **Packuments** pass `'gzip'` — the JSON corpus compresses ~4× and is
|
|
187
|
-
* transparently decompressed by the fetch layer (undici auto-decompresses
|
|
188
|
-
* on Node; on GJS the `@gjsify/fetch` shared session has libsoup's
|
|
189
|
-
* `ContentDecoder` removed and `@gjsify/fetch` does its own
|
|
190
|
-
* `DecompressionStream` decode keyed off the surviving `Content-Encoding`
|
|
191
|
-
* header — so `res.json()` here still sees plain JSON on both runtimes).
|
|
192
|
-
* This bypasses the libsoup chunked-gzip decoder bug (`G_IO_ERROR_
|
|
193
|
-
* PARTIAL_INPUT` at the tail of an npm-CDN gzip stream) that the old blanket
|
|
194
|
-
* `identity` default was working around.
|
|
195
|
-
* - **Tarballs** pass `'identity'` — they are already-gzipped `.tgz`, and
|
|
196
|
-
* transport-gzip would change which bytes the SRI `verifyIntegrity` runs
|
|
197
|
-
* over (the raw response body), breaking integrity.
|
|
198
|
-
*
|
|
199
|
-
* Callers that don't care (e.g. `whoami`) get the safe `identity` default.
|
|
200
|
-
*/
|
|
201
|
-
export declare function buildHeaders(url: string, opts: FetchOptions & {
|
|
202
|
-
acceptEncoding?: string;
|
|
203
|
-
}): Record<string, string>;
|
|
204
|
-
/** Resolve an `Authorization` header for a URL given a parsed .npmrc. */
|
|
205
|
-
export declare function resolveAuthForUrl(url: string, npmrc: NpmrcConfig): string | null;
|
|
206
|
-
/**
|
|
207
|
-
* Result of `whoami(registry, npmrc)` — the npm registry's `/-/whoami`
|
|
208
|
-
* endpoint returns `{"username": "<name>"}` for a live bearer token and an
|
|
209
|
-
* empty object `{}` for a token that the registry no longer accepts (dead /
|
|
210
|
-
* revoked / expired). The status code stays 200 in both cases; the empty
|
|
211
|
-
* body is npm's signal that the bearer was rejected.
|
|
212
|
-
*
|
|
213
|
-
* `gjsify publish` uses this distinction to give a clear diagnostic when a
|
|
214
|
-
* PUT publish call returns 404 Not Found / body "Not Found" — the typical
|
|
215
|
-
* dead-token shape that's easily mistaken for a "package does not exist"
|
|
216
|
-
* (Trusted-Publisher-bootstrap) situation.
|
|
217
|
-
*/
|
|
218
|
-
export interface WhoamiResult {
|
|
219
|
-
/** Username when the token is live. Absent (or empty string) when dead. */
|
|
220
|
-
username?: string;
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* GET `<registry>/-/whoami` with the bearer/basic Authorization derived from
|
|
224
|
-
* `npmrc`. Returns the parsed body on 2xx (`{username}` for a live token,
|
|
225
|
-
* `{}` for a dead one — both are 200 responses). **Throws** on network
|
|
226
|
-
* failures, non-2xx status, or unparseable bodies — the caller must handle
|
|
227
|
-
* the "couldn't probe" path explicitly (typically: fall back to the
|
|
228
|
-
* generic error message).
|
|
229
|
-
*
|
|
230
|
-
* Reference: `npm whoami` (refs/npm-cli/lib/commands/whoami.js) — the
|
|
231
|
-
* endpoint is documented as a registry-API canonical method.
|
|
232
|
-
*/
|
|
233
|
-
export declare function whoami(registry: string, npmrc: NpmrcConfig | undefined): Promise<WhoamiResult>;
|
|
234
|
-
export declare class PackageNotFoundError extends Error {
|
|
235
|
-
readonly name: string;
|
|
236
|
-
readonly url: string;
|
|
237
|
-
constructor(name: string, url: string);
|
|
238
|
-
}
|
|
239
|
-
export declare class IntegrityError extends Error {
|
|
240
|
-
readonly url: string;
|
|
241
|
-
readonly integrity: string;
|
|
242
|
-
constructor(url: string, integrity: string);
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Thrown when EVERY retry attempt against a registry URL exhausts the
|
|
246
|
-
* per-request timeout (`opts.timeoutMs`, default 30s). Replaces the
|
|
247
|
-
* inscrutable "signal is aborted without reason" the raw AbortSignal path
|
|
248
|
-
* would otherwise surface — `gjsify install` users seeing this know exactly
|
|
249
|
-
* what timed out, how long they waited, and that the CDN is the suspect.
|
|
250
|
-
*/
|
|
251
|
-
export declare class RegistryTimeoutError extends Error {
|
|
252
|
-
readonly url: string;
|
|
253
|
-
readonly timeoutMs: number;
|
|
254
|
-
readonly attempts: number;
|
|
255
|
-
constructor(url: string, timeoutMs: number, attempts: number);
|
|
256
|
-
}
|
|
1
|
+
export type { FetchOptions, NpmrcConfig, Packument, PackumentDist, PackumentVersion } from './types.js';
|
|
2
|
+
export { IntegrityError, PackageNotFoundError, RegistryTimeoutError } from './errors.js';
|
|
3
|
+
export { DEFAULT_REGISTRY, parseNpmrc, registryFor } from './npmrc.js';
|
|
4
|
+
export { buildHeaders, resolveAuthForUrl } from './auth.js';
|
|
5
|
+
export { fetchWithRetry } from './retry.js';
|
|
6
|
+
export { verifyIntegrity } from './integrity.js';
|
|
7
|
+
export { assertPackument, type ConditionalPackument, fetchPackument, fetchPackumentConditional, packumentUrl, } from './packument.js';
|
|
8
|
+
export { fetchTarball } from './tarball.js';
|
|
9
|
+
export { whoami, type WhoamiResult } from './whoami.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { NpmrcConfig } from './types.js';
|
|
2
|
+
export declare const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
|
|
3
|
+
/** Pick the right registry URL for a package name (scoped overrides win). */
|
|
4
|
+
export declare function registryFor(name: string, npmrc: NpmrcConfig | undefined): string;
|
|
5
|
+
/**
|
|
6
|
+
* Parse a `.npmrc` text body into the subset of npm config this client needs:
|
|
7
|
+
* the default registry, per-scope registry overrides, `_authToken` bearers and
|
|
8
|
+
* `username` / `_password` basic-auth pairs.
|
|
9
|
+
*
|
|
10
|
+
* Every other key (`_auth`, `email`, `cache`, `//host/:certfile`, …) is
|
|
11
|
+
* DROPPED — the result is a closed shape, not a passthrough bag. That is
|
|
12
|
+
* deliberate: the parsed config is handed to `buildHeaders` / `resolveAuthForUrl`
|
|
13
|
+
* and travels through error paths and verbose logs, so it must not carry
|
|
14
|
+
* credential material nobody asked for.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseNpmrc(text: string): NpmrcConfig;
|
|
17
|
+
/**
|
|
18
|
+
* Normalize a registry URL to a trailing slash. Internal to the package (not
|
|
19
|
+
* part of the public surface) — shared by every module that concatenates a
|
|
20
|
+
* path onto a registry base.
|
|
21
|
+
*/
|
|
22
|
+
export declare function ensureTrailingSlash(s: string): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { FetchOptions, Packument } from './types.js';
|
|
2
|
+
/** Strict-validate a packument shape. Throws on schema mismatch. */
|
|
3
|
+
export declare function assertPackument(name: string, body: unknown): asserts body is Packument;
|
|
4
|
+
/** Build the GET URL for a packument. Handles `@scope/name` URL-encoding. */
|
|
5
|
+
export declare function packumentUrl(name: string, registry: string): string;
|
|
6
|
+
/** Outcome of a conditional packument fetch ({@link fetchPackumentConditional}). */
|
|
7
|
+
export interface ConditionalPackument {
|
|
8
|
+
/** `'fresh'` — the registry returned a new body (200). `'not-modified'` —
|
|
9
|
+
* a 304, so the caller's cached copy is still current. */
|
|
10
|
+
status: 'fresh' | 'not-modified';
|
|
11
|
+
/** Parsed packument. Present iff `status === 'fresh'`. */
|
|
12
|
+
packument?: Packument;
|
|
13
|
+
/** The response `ETag`, to store alongside a freshly-fetched body. On a
|
|
14
|
+
* 304 this echoes back the `ifNoneMatch` the caller sent (still current). */
|
|
15
|
+
etag?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Conditional packument fetch with ETag revalidation.
|
|
19
|
+
*
|
|
20
|
+
* When `ifNoneMatch` is supplied it is sent as `If-None-Match`; a `304 Not
|
|
21
|
+
* Modified` resolves to `{ status: 'not-modified' }` (no body transferred — the
|
|
22
|
+
* caller reuses its cached packument), and a `200` resolves to `{ status:
|
|
23
|
+
* 'fresh', packument, etag }`. Without `ifNoneMatch` it behaves like
|
|
24
|
+
* {@link fetchPackument} but additionally surfaces the response ETag so the
|
|
25
|
+
* caller can seed a cache.
|
|
26
|
+
*
|
|
27
|
+
* Why revalidation rather than a TTL: packuments are mutable (new versions
|
|
28
|
+
* publish over time), so a TTL cache would serve stale data and silently miss
|
|
29
|
+
* a just-published version; a conditional GET keeps a cheap round-trip but
|
|
30
|
+
* skips the (60–98 KB, `accept-encoding: identity`) body when nothing changed.
|
|
31
|
+
* Reference: npm's make-fetch-happen HTTP-cache layer.
|
|
32
|
+
*/
|
|
33
|
+
export declare function fetchPackumentConditional(name: string, opts?: FetchOptions & {
|
|
34
|
+
ifNoneMatch?: string;
|
|
35
|
+
}): Promise<ConditionalPackument>;
|
|
36
|
+
/** Fetch + parse a packument. Retries on transient errors (see fetchWithRetry). */
|
|
37
|
+
export declare function fetchPackument(name: string, opts?: FetchOptions): Promise<Packument>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { FetchOptions } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Wrap a single GET in exponential-backoff retry for transient failures.
|
|
4
|
+
*
|
|
5
|
+
* Retries on:
|
|
6
|
+
* - network-layer errors thrown by `fetch` (TypeError "fetch failed",
|
|
7
|
+
* `Gio.TlsError` from Soup-backed GJS fetch when the registry CDN drops
|
|
8
|
+
* the TLS handshake mid-stream, ECONNRESET, ENETUNREACH, …)
|
|
9
|
+
* - HTTP 408 (Request Timeout), 425 (Too Early), 429 (rate limit),
|
|
10
|
+
* 500-503, 504, 522, 524 (Cloudflare upstream)
|
|
11
|
+
* - per-request timeout (opts.timeoutMs, default 30s) — the AbortError
|
|
12
|
+
* surfaced by a fired timeout signal is treated as transient (slow
|
|
13
|
+
* CDN) and retried like any other network blip; distinguished from
|
|
14
|
+
* a caller-triggered abort via the abort signal's `reason` identity.
|
|
15
|
+
*
|
|
16
|
+
* Does NOT retry on:
|
|
17
|
+
* - 4xx other than 408/425/429 (semantic errors — 404 surfaces via the
|
|
18
|
+
* caller's PackageNotFoundError path) UNLESS `opts.retryNotFound` is set,
|
|
19
|
+
* which `fetchTarball` enables so a transient CDN 404 on a `.tgz` (whose
|
|
20
|
+
* URL already came from a resolved packument) is retried like any blip
|
|
21
|
+
* - AbortError from the CALLER's signal (`opts.signal` — caller wants out)
|
|
22
|
+
* - any other thrown shape that doesn't look transient
|
|
23
|
+
*
|
|
24
|
+
* Default schedule: 250ms, 500ms, 1000ms (3 retries → 4 total attempts);
|
|
25
|
+
* capped at 8s per delay. Caller can tune via opts.retries / opts.retryDelayMs
|
|
26
|
+
* / opts.timeoutMs.
|
|
27
|
+
*
|
|
28
|
+
* When ALL retries exhaust because of per-request timeouts, throws a
|
|
29
|
+
* typed `RegistryTimeoutError` (not the raw "signal is aborted without
|
|
30
|
+
* reason" the underlying fetch would surface) so the user gets a clear
|
|
31
|
+
* "<url> timed out after Xs × N attempts" message.
|
|
32
|
+
*/
|
|
33
|
+
export declare function fetchWithRetry(url: string, init: {
|
|
34
|
+
headers: Record<string, string>;
|
|
35
|
+
signal?: AbortSignal;
|
|
36
|
+
compress?: boolean;
|
|
37
|
+
}, opts: Pick<FetchOptions, 'fetch' | 'retries' | 'retryDelayMs' | 'timeoutMs' | 'onRetry' | 'retryNotFound'>): Promise<Response>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export interface NpmrcConfig {
|
|
2
|
+
/** Default registry URL (trailing slash kept as written). */
|
|
3
|
+
registry: string;
|
|
4
|
+
/** Registry overrides per scope: `{"@scope": "https://registry/"}`. */
|
|
5
|
+
scopes: Record<string, string>;
|
|
6
|
+
/** Auth tokens keyed by `//host/path/:` prefix (npm convention). */
|
|
7
|
+
authTokens: Record<string, string>;
|
|
8
|
+
/** Basic-auth credentials keyed by host prefix. */
|
|
9
|
+
basicAuth: Record<string, {
|
|
10
|
+
username: string;
|
|
11
|
+
password: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
/** Distribution metadata for a single version. */
|
|
15
|
+
export interface PackumentDist {
|
|
16
|
+
tarball: string;
|
|
17
|
+
integrity?: string;
|
|
18
|
+
shasum?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Single version record inside a packument. */
|
|
21
|
+
export interface PackumentVersion {
|
|
22
|
+
name: string;
|
|
23
|
+
version: string;
|
|
24
|
+
dist: PackumentDist;
|
|
25
|
+
dependencies?: Record<string, string>;
|
|
26
|
+
optionalDependencies?: Record<string, string>;
|
|
27
|
+
bin?: string | Record<string, string>;
|
|
28
|
+
deprecated?: string;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
/** Top-level packument shape returned by `GET /<pkg>`. */
|
|
32
|
+
export interface Packument {
|
|
33
|
+
name: string;
|
|
34
|
+
'dist-tags': Record<string, string>;
|
|
35
|
+
versions: Record<string, PackumentVersion>;
|
|
36
|
+
time?: Record<string, string>;
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
}
|
|
39
|
+
export interface FetchOptions {
|
|
40
|
+
/** Override registry URL. Default: $npm_config_registry || DEFAULT_REGISTRY. */
|
|
41
|
+
registry?: string;
|
|
42
|
+
/** Pre-parsed .npmrc; if omitted, no auth is sent. */
|
|
43
|
+
npmrc?: NpmrcConfig;
|
|
44
|
+
/** Pre-built header map (overrides anything else). */
|
|
45
|
+
headers?: Record<string, string>;
|
|
46
|
+
/** AbortSignal forwarded to fetch. */
|
|
47
|
+
signal?: AbortSignal;
|
|
48
|
+
/** Custom fetch implementation; default = globalThis.fetch. */
|
|
49
|
+
fetch?: typeof fetch;
|
|
50
|
+
/**
|
|
51
|
+
* Max retry attempts on transient failures (network errors, TLS handshake
|
|
52
|
+
* resets, 5xx, 408, 429). Default 3 → up to 4 total attempts. Set to 0
|
|
53
|
+
* to disable retry.
|
|
54
|
+
*/
|
|
55
|
+
retries?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Initial backoff in ms; doubles per attempt. Default 250 → 250, 500, 1000.
|
|
58
|
+
* The cap is 8s per delay so a bad spell stays bounded.
|
|
59
|
+
*/
|
|
60
|
+
retryDelayMs?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Per-request timeout in ms. Default 30000 (30s). Set to 0 to disable.
|
|
63
|
+
*
|
|
64
|
+
* Guards against the reachable-but-slow registry case where TCP connect
|
|
65
|
+
* succeeds but the response body never finishes — a single packument
|
|
66
|
+
* fetch would otherwise await indefinitely with no resource cleanup,
|
|
67
|
+
* no error message, no progress (the exact shape of an observed
|
|
68
|
+
* `gjsify install` hang). A timeout fires an AbortError that the retry
|
|
69
|
+
* loop treats as transient (CDN slowdowns recover), so a slow attempt
|
|
70
|
+
* gets retried per the retries / retryDelayMs schedule. When ALL
|
|
71
|
+
* retries exhaust because of timeouts, a `RegistryTimeoutError` is
|
|
72
|
+
* thrown with a clear "timed out after Xs × N attempts" message.
|
|
73
|
+
*/
|
|
74
|
+
timeoutMs?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Called once per retry with `{ attempt, error, delayMs }`. Useful for
|
|
77
|
+
* verbose-mode install logs ("retrying fetch in 500 ms…").
|
|
78
|
+
*/
|
|
79
|
+
onRetry?: (info: {
|
|
80
|
+
attempt: number;
|
|
81
|
+
error: unknown;
|
|
82
|
+
delayMs: number;
|
|
83
|
+
}) => void;
|
|
84
|
+
/**
|
|
85
|
+
* Treat HTTP 404 as a transient (retryable) failure rather than a hard
|
|
86
|
+
* "not found". Default false. Opt in for TARBALL fetches: a tarball URL
|
|
87
|
+
* already came from a successfully-resolved packument, so a 404 on the
|
|
88
|
+
* `.tgz` is a registry/CDN hiccup under load (observed on heavy parallel
|
|
89
|
+
* `@girs/*` installs — npm itself fails the same way) rather than a
|
|
90
|
+
* genuinely-missing artifact. Packument 404s must stay permanent (the
|
|
91
|
+
* package really doesn't exist), so leave this false there.
|
|
92
|
+
*/
|
|
93
|
+
retryNotFound?: boolean;
|
|
94
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { NpmrcConfig } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Result of `whoami(registry, npmrc)` — the npm registry's `/-/whoami`
|
|
4
|
+
* endpoint returns `{"username": "<name>"}` for a live bearer token and an
|
|
5
|
+
* empty object `{}` for a token that the registry no longer accepts (dead /
|
|
6
|
+
* revoked / expired). The status code stays 200 in both cases; the empty
|
|
7
|
+
* body is npm's signal that the bearer was rejected.
|
|
8
|
+
*
|
|
9
|
+
* `gjsify publish` uses this distinction to give a clear diagnostic when a
|
|
10
|
+
* PUT publish call returns 404 Not Found / body "Not Found" — the typical
|
|
11
|
+
* dead-token shape that's easily mistaken for a "package does not exist"
|
|
12
|
+
* (Trusted-Publisher-bootstrap) situation.
|
|
13
|
+
*/
|
|
14
|
+
export interface WhoamiResult {
|
|
15
|
+
/** Username when the token is live. Absent (or empty string) when dead. */
|
|
16
|
+
username?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* GET `<registry>/-/whoami` with the bearer/basic Authorization derived from
|
|
20
|
+
* `npmrc`. Returns the parsed body on 2xx (`{username}` for a live token,
|
|
21
|
+
* `{}` for a dead one — both are 200 responses). **Throws** on network
|
|
22
|
+
* failures, non-2xx status, or unparseable bodies — the caller must handle
|
|
23
|
+
* the "couldn't probe" path explicitly (typically: fall back to the
|
|
24
|
+
* generic error message).
|
|
25
|
+
*
|
|
26
|
+
* Reference: `npm whoami` (refs/npm-cli/lib/commands/whoami.js) — the
|
|
27
|
+
* endpoint is documented as a registry-API canonical method.
|
|
28
|
+
*/
|
|
29
|
+
export declare function whoami(registry: string, npmrc: NpmrcConfig | undefined): Promise<WhoamiResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/npm-registry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"description": "npm registry client for the gjsify install backend — packuments, tarballs, .npmrc auth (Node + GJS)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -26,7 +26,10 @@
|
|
|
26
26
|
"build:test:node": "gjsify build src/test.mts --app node --outfile test.node.mjs",
|
|
27
27
|
"test": "gjsify run build:gjsify && gjsify run build:test && gjsify run test:node && gjsify run test:gjs",
|
|
28
28
|
"test:gjs": "gjsify run test.gjs.mjs",
|
|
29
|
-
"test:node": "node test.node.mjs"
|
|
29
|
+
"test:node": "node test.node.mjs",
|
|
30
|
+
"test:bun": "bun test.node.mjs",
|
|
31
|
+
"test:deno": "deno run -A --no-lock --node-modules-dir=none test.node.mjs",
|
|
32
|
+
"test:cross-runtime": "gjsify run build:test:node && gjsify run test:node && gjsify run test:bun && gjsify run test:deno"
|
|
30
33
|
},
|
|
31
34
|
"keywords": [
|
|
32
35
|
"gjs",
|
|
@@ -37,8 +40,8 @@
|
|
|
37
40
|
],
|
|
38
41
|
"license": "MIT",
|
|
39
42
|
"devDependencies": {
|
|
40
|
-
"@gjsify/cli": "^0.
|
|
41
|
-
"@gjsify/unit": "^0.
|
|
43
|
+
"@gjsify/cli": "^0.24.1",
|
|
44
|
+
"@gjsify/unit": "^0.24.1",
|
|
42
45
|
"typescript": "^6.0.3"
|
|
43
46
|
},
|
|
44
47
|
"repository": {
|
|
@@ -51,6 +54,11 @@
|
|
|
51
54
|
},
|
|
52
55
|
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/infra/npm-registry#readme",
|
|
53
56
|
"gjsify": {
|
|
54
|
-
"tier": 1
|
|
57
|
+
"tier": 1,
|
|
58
|
+
"defineFromPackageJson": {
|
|
59
|
+
"__PACKAGE_VERSION__": {
|
|
60
|
+
"field": "version"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
55
63
|
}
|
|
56
64
|
}
|