resolves urls and provides fs like access
Holds context information
Type: URL
url
URL
Returns URL
Called when authorization is required for a given realm asks options.provideCredentials() and resolver.provideCredentials()
realm
Object requested (decoded) realm
Returns Promise<Object> credentials for the given realm
Extends URLScheme
URLScheme for http requests
options
Object
Returns Promise fetch result
Execute a GET request
Returns Promise body of the response
Execute a PUT request
context
Context execution contexturl
URL destinationstream
Stream content to be put to the urloptions
Object
Execute a HEAD request
Returns Object response object
inserts the authorization data into the reguest header
Returns boolean true if auth info has been written into headers
Returns string 'http'
Returns number 80 the http default port
Extract options suitable for the constructor form the given set of environment variables
env
Object
Returns Object undefined if no suitable environment variables have been found
Extends HTTPScheme
URLScheme for https requests
Returns string 'https'
Returns number 443 the https default port
Returns boolean true
Extends URLScheme
Holds a map of url-schemes and dispatches requests
config
Object (optional, default{}
)predefinedConstructors
Array<URLScheme> schemes to start with (optional, default[]
)env
Object environment variables as present in process.env (optional, default{}
)
Register a scheme for later lookup
scheme
URLScheme
Get URLScheme for a given url
url
URL
Returns URLScheme for a given url or undefined if nothing found
Resolve for a given url. Passes url to the registered scheme for remapping
url
URL to be resolved
Returns URL resolved url or original URL if no remapping found
Create a new context
options
Object context
Returns Context newly created context
Called when authorization is required. Forwards the request to the registered auth providers
realm
string requested realm
Returns Object credentials as given by one of the registered auth providers
Extends URLScheme
Remap url special:some/path -> https://myserver.com/repo/some/path name: special baseScheme: https prefix: https://myserver.com/repo/
baseScheme
URLSchemename
string of the newly created schemeprefix
string urls will be prefixed by this valueoptions
baseScheme
URLSchemename
string of the newly created schemeprefix
string urls will be prefixed by this value
Remapps url by separating scheme (and direct following '/') from suffix and appending the suffix (in front)
url
URL to be remapped
Returns URL remapped url
options
Object raw config
options
Object raw config
Should be overwritten to reflect the scheme name
Returns string scheme name (defaults to the class name)
Returns number default from static defaultPort
Returns boolean default from static isSecure
List collection (directory)
Returns Promise resolves to iterable entries
Get content of a url
Returns Promise resolves to the content
Delivers meta information for a given url
Returns Promise resolves to one entry
Put the content of a stream to a given url
Returns Promise resolves if stream has ben put to the url
Deletes object at a given url
Returns Promise resolves to the history of the object at the given url
Deliver history information for a given url
Returns Promise resolves to the history of the object at the given url
Called when authorization is required for a given realm Tries provideCredentials() on the options object first and then calls provideCredentials() on the context.
Returns Promise<Object> holding the credentials
supported methods
Returns Array<string> 'get', 'stat', 'put', 'delete', 'list', 'history'
Returns boolean false
Returns mumber undefined by default
Default configuration options
Returns Object
Extract options suitable for the constructor form the given set of environment variables
env
Object
Returns Object undefined if no suitable environment variables have been found
Pepare configuration by mixing together defaultOptions with actual options
options
Object raw config
Returns Object combined options
- See: rfc7235
Parse WWW-Authenticate header and provide parts as object. provides a two level structure 1st. the algorithm and then the algorithm attributes
source
string http header 'WWW-Authenticate'result
Object where to put result into (optional, default{}
)
Returns Object same as result
Extends Error
general fetch response error
With npm do:
npm install url-resolver-fs
BSD-2-Clause