UNPKG

@nephele/adapter-nymph

Version:

Nymph.js based deduping file adapter for the Nephele WebDAV server.

66 lines 1.62 kB
import { InternalServerError } from 'nephele'; export default class Lock { get token() { return this.nymphLock.token; } set token(value) { this.nymphLock.token = value; } get date() { return new Date(this.nymphLock.date); } set date(value) { this.nymphLock.date = value.getTime(); } get timeout() { return this.nymphLock.timeout; } set timeout(value) { this.nymphLock.timeout = value; } get scope() { return this.nymphLock.scope; } set scope(value) { this.nymphLock.scope = value; } get depth() { return this.nymphLock.depth; } set depth(value) { this.nymphLock.depth = value; } get provisional() { return this.nymphLock.provisional; } set provisional(value) { this.nymphLock.provisional = value; } get owner() { return this.nymphLock.owner; } set owner(value) { this.nymphLock.owner = value; } get username() { return this.nymphLock.username; } set username(value) { this.nymphLock.username = value; } constructor({ resource, nymphLock, }) { this.resource = resource; this.nymphLock = nymphLock; } async save() { if (!(await this.nymphLock.$save())) { throw new InternalServerError("Couldn't save lock."); } } async delete() { if (!(await this.nymphLock.$deleteSkipAC())) { throw new InternalServerError("Couldn't delete lock."); } } } //# sourceMappingURL=Lock.js.map