An incoming HTTP request;
An outgoing HTTP response;
Different log levels, from most important to least important.
Represents preferred values along a single content negotiation dimension.
The number represents how preferred this value is from 0 to 1. Follows the quality values rule from RFC 7231: "The weight is normalized to a real number in the range 0 through 1, where 0.001 is the least preferred and 1 is the most preferred; a value of 0 means "not acceptable"."
Resolves a path to its absolute form. Absolute inputs will not be changed (except changing Windows to POSIX). Relative inputs will be interpreted relative to process.cwd().
Path to check (POSIX or Windows).
The potentially changed path (POSIX).
Generates resources with the given generator and adds them to the given store.
Identifier of the pod.
Settings from which the pod is being created.
Generator to be used.
Store to be updated.
The amount of resources that were added.
Adds a header value without overriding previous values.
Creates a function that expands local names from the given base URI, and exports the given local names as properties on the returned object.
Creates a regular expression that matches URLs containing the given baseUrl, or a subdomain of the given baseUrl. In case there is a subdomain, the first match of the regular expression will be that subdomain.
Examples with baseUrl http://test.com/foo/
:
http://test.com/foo/
http://test.com/foo/bar/baz
http://alice.bob.test.com/foo/bar/baz
, first match result will be alice.bob
http://test.com/
http://alicetest.com/foo/
Base URL for the regular expression.
Creates a function that expands local names from the given base URI into named nodes, and exports the given local names as properties on the returned object.
Creates a function that expands local names from the given base URI into string,
and exports the given local names as properties on the returned object.
Under the terms
property, it exposes the expanded local names as named nodes.
Creates a function that expands local names from the given base URI into strings, and exports the given local names as properties on the returned object.
Decodes all components of a URI path.
Encodes all (non-slash) special characters in a URI path.
Makes sure the input path has exactly 1 slash at the end. Multiple slashes will get merged into one. If there is no slash it will be added.
Path to check.
The potentially changed path.
Splits a URL (or similar) string into a part containing its scheme and one containing the rest.
E.g., http://test.com/
results in { scheme: 'http://', rest: 'test.com/' }
.
String to parse.
Extracts the extension (without dot) from a path.
Custom function since path.extname
does not work on all cases (e.g. ".acl")
Input path to parse.
Gets a logger instance for the given class instance.
The returned type of logger depends on the configured LoggerFactory in {@link Setup}.
The following shows a typical pattern on how to create loggers:
class MyClass {
protected readonly logger = getLoggerFor(this);
}
If no class is applicable, a logger can also be created as follows:
const logger = getLoggerFor('MyFunction');
A class instance or a class string name.
Makes sure that listeners always receive the error event of a stream, even if it was thrown before the listener was attached.
When guarding a stream it is assumed that error listeners already attached should be ignored, only error listeners attached after the stream is guarded will prevent an error from being logged.
If the input is already guarded the guard will be reset, which means ignoring error listeners already attached.
Stream that can potentially throw an error.
The stream.
Determines whether any available type satisfies the preferences.
Preferences for output type.
Media types to compare to the preferences.
Whether there is at least one preference match.
Checks if the identifier corresponds to a container identifier.
Identifier to check.
Checks if the path corresponds to a container path (ending in a /).
Path to check.
Determines whether the stream is guarded from emitting errors.
Determines whether the object is a RepresentationMetadata
.
Determines whether the object is a ResourceIdentifier
.
Checks if this is a {@link Term}.
Checks if the given variable is one that is supported. This can be used to weed out irrelevant parameters in an object.
Adds the paths to the base path.
The base path (POSIX or Windows).
Subpaths to attach (POSIX).
The potentially changed path (POSIX).
Checks if the given two media types/ranges match each other. Takes wildcards into account.
Media type to match.
Media type to match.
True if the media type patterns can match each other.
Filters media types based on the given preferences.
Based on RFC 7231 - Content negotiation.
Will add a default internal/*;q=0
to the preferences to prevent accidental use of internal types.
Since more specific media ranges override less specific ones,
this will be ignored if there is a specific internal type preference.
This should be called even if there are no preferredTypes since this also filters out internal types.
Preferences for output type.
Media types to compare to the preferences.
The weighted and filtered list of matching types.
Resolves relative segments in the path.
Path to check (POSIX or Windows).
The potentially changed path (POSIX).
Parses an Accept-Charset header string.
The Accept-Charset header string.
An array of AcceptCharset objects, sorted by weight.
Parses an Accept-DateTime header string.
The Accept-DateTime header string.
An array with a single AcceptDatetime object.
Parses an Accept-Encoding header string.
The Accept-Encoding header string.
An array of AcceptEncoding objects, sorted by weight.
Parses an Accept-Language header string.
The Accept-Language header string.
An array of AcceptLanguage objects, sorted by weight.
Parses a Forwarded header value and will fall back to X-Forwarded-* headers.
The incoming HTTP headers.
The parsed Forwarded header.
Parses a list of split parameters and checks their validity.
A list of split parameters (token [ "=" ( token / quoted-string ) ])
The double quoted strings that need to be replaced.
An array of name/value objects corresponding to the parameters.
Helper function to convert a Readable into an array of quads.
The readable object.
Options for the parser.
A promise containing the array of quads.
Pipes one stream into another and emits errors of the first stream with the second. In case of an error in the first stream the second one will be destroyed with the given error. This will also make the stream Guarded.
Initial readable stream.
The destination for writing data.
Optional function that takes the error and converts it to a new error.
The destination stream.
Generates a quad with the given subject/predicate/object and pushes it to the given array.
Joins all strings of a stream.
Stream of strings.
The joined string.
Resets the global logger factory to undefined.
This typically only needs to be called during testing. Call this at your own risk.
Helper function for serializing an array of quads, with as result a Readable object.
The array of quads.
The content-type to serialize to.
The Readable object.
Sets the global logger factory. This will cause all loggers created by getLoggerFor to be delegated to a logger from the given factory.
A logger factory.
Splits the input string on commas, trims all parts and filters out empty ones.
Input header string.
Determines whether the given conversion request is supported, given the available content type conversions:
Actual input type.
Acceptable output types.
Media types that can be parsed by the converter.
Media types that can be produced by the converter.
Converts the incoming name (URI or shorthand) to a named node. The generated terms get cached to reduce the number of created nodes, so only use this for internal constants!
Predicate to potentially transform.
Converts a URI path to the canonical version by splitting on slashes, decoding any percent-based encodings, and then encoding any special characters.
Creates a literal by first converting the dataType string to a named node.
Object value.
Object data type (as string).
Converts an object term when needed.
Object to potentially transform.
Whether strings are converted to literals or named nodes.
Converts a subject to a named node when needed.
Subject to potentially transform.
Replaces all double quoted strings in the input string with "0"
, "1"
, etc.
The Accept header string.
The transformed string and a map with keys "0"
, etc. and values the original string that was there.
Transforms a stream, ensuring that all errors are forwarded.
The stream to be transformed
The transformed stream
Makes sure the input path has no slashes at the end.
Path to check.
The potentially changed path.
A stream that is guarded from emitting errors when there are no listeners. If an error occurs while no listener is attached, it will store the error and emit it once a listener is added (or a timeout occurs).