STATUSESconstconst STATUSES: readonly [200, 201, 204, 206, 207, 304, 400, 401, 403, 404, 405, 409, 412, 413, 414, 415, 416, 423, 424, 500, 501, 502, 503]The statuses the server gives.
The statuses the server gives, as a closed list, and the total table from the code of the POSIX view to the status: what a local file system would have said as an errno is said here as the status a WebDAV client expects. A few codes mean something else in a few methods (an existing name is 405 for a new collection and 412 for a copy that may not overwrite), so the table takes the context.
import { statusOfErrno } from "./status.ts";
statusOfErrno("ENOENT", "other"); // 404
statusOfErrno("EEXIST", "mkcol"); // 405STATUSESconstconst STATUSES: readonly [200, 201, 204, 206, 207, 304, 400, 401, 403, 404, 405, 409, 412, 413, 414, 415, 416, 423, 424, 500, 501, 502, 503]The statuses the server gives.
Statustypeno test imports ittype Status = (typeof STATUSES)[number];One status.
STATUS_TEXTconstconst STATUS_TEXT: Readonly<Record<200 | 201 | 204 | 206 | 207 | 304 | 400 | 401 | 403 | 404 | 405 | 409 | 412 | 413 | 414 | 415 | 416 | 423 | 424 | 500 | 501 | 502 | 503, string>>The words of a status.
statusLinefunctionno test imports itfunction statusLine(status: 200 | 201 | 204 | 206 | 207 | 304 | 400 | 401 | 403 | 404 | 405 | 409 | 412 | 413 | 414 | 415 | 416 | 423 | 424 | 500 | 501 | 502 | 503): stringThe status line of a multistatus body.
Contexttypetype Context = "mkcol" | "exclusive" | "move-copy" | "other";What a request was doing when the view said no: the one thing that changes what a code means.
statusOfErrnofunctionfunction statusOfErrno(errno: "EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV", context: Context): 200 | 201 | 204 | 206 | 207 | 304 | 400 | 401 | 403 | 404 | 405 | 409 | 412 | 413 | 414 | 415 | 416 | 423 | 424 | 500 | 501 | 502 | 503The status of a code, in a context: a registry with one entry for each code, which the compiler holds.
RETRY_AFTER_SECONDSconstno test imports itconst RETRY_AFTER_SECONDS: 5Whether the status of a store that is not there now is one a client should try again: 503 with a wait.