DAV_METHODSconstconst DAV_METHODS: readonly ["OPTIONS", "GET", "HEAD", "PUT", "DELETE", "MKCOL", "COPY", "MOVE", "PROPFIND", "PROPPATCH", "LOCK", "UNLOCK"]The methods, in the order of the Allow header.
The methods the server answers, as a closed union: the twelve of WebDAV class 1 and 2 that an object store can carry. A method that is not one of them is answered 405 with the list in Allow.
import { parseMethod } from "./methods.ts";
parseMethod("PROPFIND"); // "PROPFIND"
parseMethod("PATCH"); // undefinedDAV_METHODSconstconst DAV_METHODS: readonly ["OPTIONS", "GET", "HEAD", "PUT", "DELETE", "MKCOL", "COPY", "MOVE", "PROPFIND", "PROPPATCH", "LOCK", "UNLOCK"]The methods, in the order of the Allow header.
DavMethodtypeno test imports ittype DavMethod = (typeof DAV_METHODS)[number];One method.
parseMethodfunctionfunction parseMethod(text: string): "COPY" | "DELETE" | "GET" | "HEAD" | "LOCK" | "MKCOL" | "MOVE" | "OPTIONS" | "PROPFIND" | "PROPPATCH" | "PUT" | "UNLOCK" | undefinedThe method a text names, or nothing: method names are upper case and exact.
changesStorefunctionfunction changesStore(method: "COPY" | "DELETE" | "GET" | "HEAD" | "LOCK" | "MKCOL" | "MOVE" | "OPTIONS" | "PROPFIND" | "PROPPATCH" | "PUT" | "UNLOCK"): booleanWhether a method changes the store: these need the capability to write and a lock the caller holds.
allowedMethodsfunctionfunction allowedMethods(writable: boolean, locks: boolean): readonly ("COPY" | "DELETE" | "GET" | "HEAD" | "LOCK" | "MKCOL" | "MOVE" | "OPTIONS" | "PROPFIND" | "PROPPATCH" | "PUT" | "UNLOCK")[]The value of the Allow header for a store that can write or one that cannot.