@vltpkg/registry-client
Classes
RegistryClient
Defined in: index.ts:145
Constructors
new RegistryClient()
Defined in: index.ts:149
Parameters
options
Returns
Properties
agent
Defined in: index.ts:146
cache
Defined in: index.ts:147
Methods
login()
Defined in: index.ts:249
Log into the registry specified
Does not return the token or expose it, just saves to the auth keychain and returns void if it worked. Otherwise, error is raised.
Parameters
registry
string
Returns
Promise
<void
>
logout()
Defined in: index.ts:217
Log out from the registry specified, attempting to destroy the token if the registry supports that endpoint.
Parameters
registry
string
Returns
Promise
<void
>
request()
Defined in: index.ts:331
Parameters
url
string
| URL
options
RegistryClientRequestOptions
= {}
Returns
Promise
<CacheEntry
>
scroll()
Defined in: index.ts:186
Fetch the entire set of a paginated list of objects
Type Parameters
• T
Parameters
url
string
| URL
options
RegistryClientRequestOptions
= {}
seek?
(obj
) => boolean
Returns
Promise
<T
[]>
seek()
Defined in: index.ts:205
find a given item in a paginated set
Type Parameters
• T
Parameters
url
string
| URL
seek
(obj
) => boolean
options
RegistryClientRequestOptions
= {}
Returns
Promise
<undefined
| T
>
webAuthOpener()
Defined in: index.ts:286
Given a WebAuthChallenge, open the loginUrl
in a browser and
hang on the doneUrl
until it returns a TokenResponse object.
Parameters
__namedParameters
Returns
Promise
<TokenResponse
>
Type Aliases
RegistryClientOptions
Defined in: index.ts:42
Type declaration
cache?
Path on disk where the cache should be stored
Default
$HOME/.config/vlt/cache
fetch-retries?
Number of retries to perform when encountering network errors or likely-transient errors from git hosts.
fetch-retry-factor?
The exponential backoff factor to use when retrying git hosts
fetch-retry-maxtimeout?
Maximum number of milliseconds between two retries
fetch-retry-mintimeout?
Number of milliseconds before starting first retry
RegistryClientRequestOptions
Defined in: index.ts:61
Type declaration
cache?
Set to false
to suppress ANY lookups from cache. This will also
prevent storing the result to the cache.
integrity?
Provide an SRI string to verify integrity of the item being fetched.
This is only relevant when it must make a request to the registry. Once in the local disk cache, items are assumed to be trustworthy.
maxRedirections?
Follow up to 10 redirections by default. Set this to 0 to just return the 3xx response. If the max redirections are expired, and we still get a redirection response, then fail the request. Redirection cycles are always treated as an error.
method?
Method is optional, defaults to ‘GET’
path?
path
should not be set when using the RegistryClient.
It will be overwritten with the path on the URL being requested.
This only here for compliance with the DispatchOptions base type.
Deprecated
Token
Defined in: auth.ts:3
TokenResponse
Defined in: token-response.ts:1
Type declaration
token
WebAuthChallenge
Defined in: web-auth-challenge.ts:1
Type declaration
doneUrl
loginUrl
Variables
kc
Defined in: auth.ts:6
userAgent
Defined in: index.ts:125
References
CacheEntry
Re-exports CacheEntry
JSONObj
Re-exports JSONObj