Optional
patch?: string[]Optional
post?: string[]Optional
put?: string[]Private
Readonly
acceptPrivate
Readonly
supportedChecks if the input can be handled by this class. If it cannot handle the input, rejects with an error explaining why.
Input that could potentially be handled.
A promise resolving if the input can be handled, rejecting with an Error if not.
Private
filterStarts from the stored set of methods and removes all those that are not allowed based on the metadata.
Private
generateGenerates the Accept-[Method] headers if required.
Will be added if the Allow header was added, or in case of a 415 error.
Specific Accept-[Method] headers will only be added if the method is in the methods
set.
Private
generateGenerates the Allow header if required. It only needs to get added for successful GET/HEAD requests, 404s, or 405s. The spec only requires it for GET/HEAD requests and 405s. In the case of other error messages we can't deduce what the request method was, so we do not add the header as we don't have enough information.
Handles the given input. This may only be called if canHandle did not reject. When unconditionally calling both in sequence, consider handleSafe instead.
Input that needs to be handled.
A promise resolving when handling is finished.
Helper function that first runs canHandle followed by handle. Throws the error of canHandle if the data cannot be handled, or returns the result of handle otherwise.
Input data that will be handled if it can be handled.
A promise resolving if the input can be handled, rejecting with an Error if not.
Private
isDELETE is allowed if the target exists, is not a container, or is an empty container that isn't a storage.
Note that the identifier value check only works if the metadata is not about an error.
Private
isPOST is only allowed on containers. The metadata URI is only valid in case there is resource metadata, otherwise it is just a blank node.
Private
isPUT is not allowed on existing containers.
Generates Allow, Accept-Patch, Accept-Post, and Accept-Put headers. The resulting values depend on the choses input methods and types. The input metadata also gets used to remove methods from that list if they are not valid in the given situation.