UNPKG

nephele

Version:

Highly customizable and extensible WebDAV server for Node.js and Express.

73 lines (72 loc) 3.51 kB
import { Readable } from 'node:stream'; import type { Request } from 'express'; import * as xml2js from 'xml2js'; import type { AuthResponse, Lock, PluginEvent, Resource, User } from '../Interfaces/index.js'; import type { Options } from '../Options.js'; export declare class Method { opts: Options; DEV: boolean; xmlParser: xml2js.Parser; xmlBuilder: xml2js.Builder; constructor(opts: Options); runPlugins(request: Request, response: AuthResponse, event: PluginEvent, data?: any): Promise<boolean>; run(request: Request, _response: AuthResponse): Promise<void>; checkAuthorization(request: Request, response: AuthResponse, method?: string, url?: URL): Promise<void>; getAdapter(request: Request, response: AuthResponse, unencodedPath: string): Promise<import("../Interfaces/Adapter.js").Adapter>; getAdapterBaseUrl(response: AuthResponse, unencodedPath: string): Promise<string>; pathsHaveSameAdapter(response: AuthResponse, unencodedPathA: string, unencodedPathB: string): Promise<boolean>; isAdapterRoot(request: Request, response: AuthResponse, url: URL): Promise<boolean>; getParentResource(request: Request, response: AuthResponse, resource: Resource): Promise<Resource | undefined>; removeAndDeleteTimedOutLocks(locks: Lock[]): Promise<Lock[]>; getCurrentResourceLocks(resource: Resource): Promise<Lock[]>; getCurrentResourceLocksByUser(resource: Resource, user: User): Promise<Lock[]>; private getLocksGeneral; getLocks(request: Request, response: AuthResponse, resource: Resource): Promise<{ all: Lock[]; resource: Lock[]; depthZero: Lock[]; depthInfinity: Lock[]; }>; getLocksByUser(request: Request, response: AuthResponse, resource: Resource, user: User): Promise<{ all: Lock[]; resource: Lock[]; depthZero: Lock[]; depthInfinity: Lock[]; }>; getProvisionalLocks(request: Request, response: AuthResponse, resource: Resource): Promise<{ all: Lock[]; resource: Lock[]; depthZero: Lock[]; depthInfinity: Lock[]; }>; getLockPermission(request: Request, response: AuthResponse, resource: Resource, user: User): Promise<0 | 1 | 2 | 3>; getRequestLockTockens(request: Request): string[]; private checkIfHeader; checkConditionalHeaders(request: Request, response: AuthResponse): Promise<void>; getRequestUrl(request: Request): URL; getRequestedEncoding(request: Request, response: AuthResponse): "gzip" | "x-gzip" | "deflate" | "br" | "identity"; getCacheControl(request: Request): { [k: string]: number | true; }; getRequestData(request: Request, response: AuthResponse): { url: URL; encoding: "gzip" | "deflate" | "br" | "identity" | "x-gzip"; cacheControl: { [k: string]: number | true; }; }; getRequestDestination(request: Request): URL | undefined; getBodyStream(request: Request, response: AuthResponse): Promise<Readable>; sendBodyContent(response: AuthResponse, content: string, encoding: 'gzip' | 'x-gzip' | 'deflate' | 'br' | 'identity'): Promise<void>; getBodyXML(request: Request, response: AuthResponse): Promise<string | null>; parseXml(xml: string): Promise<{ output: any; prefixes: { [k: string]: string; }; }>; renderXml(xml: any, prefixes?: { [k: string]: string; }): Promise<string>; formatLocks(locks: Lock[]): Promise<{}>; }