Skip to content

Commit

Permalink
Made the 'treeFilePath' server option of 'autoLoad' optional (default…
Browse files Browse the repository at this point in the history
… value is the 'treeFilePath' of 'autoSave') + Changed the type of the 'privilegeManager' server option from the old 'IPrivilegeManager' to the new 'PrivilegeManager'
  • Loading branch information
AdrienCastex committed Jun 28, 2017
1 parent 358e2ee commit 386f04a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions lib/server/v2/WebDAVServerOptions.d.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/// <reference types="node" />
import { HTTPAuthentication } from '../../user/v2/authentication/HTTPAuthentication';
import { Writable, Readable } from 'stream';
import { IPrivilegeManager } from '../../user/v2/privilege/IPrivilegeManager';
import { PrivilegeManager } from '../../user/v2/privilege/PrivilegeManager';
import { FileSystem } from '../../manager/v2/fileSystem/FileSystem';
import { FileSystemSerializer } from '../../manager/v2/fileSystem/Serialization';
import * as https from 'https';
export interface IAutoSave {
treeFilePath: string;
tempTreeFilePath: string;
tempTreeFilePath?: string;
onSaveError?: (error: Error) => void;
streamProvider?: (inputStream: Writable, callback: (outputStream?: Writable) => void) => void;
}
export interface IAutoLoad {
treeFilePath: string;
treeFilePath?: string;
serializers?: FileSystemSerializer[];
streamProvider?: (inputStream: Readable, callback: (outputStream?: Readable) => void) => void;
}
export declare class WebDAVServerOptions {
requireAuthentification?: boolean;
httpAuthentication?: HTTPAuthentication;
privilegeManager?: IPrivilegeManager;
privilegeManager?: PrivilegeManager;
rootFileSystem?: FileSystem;
lockTimeout?: number;
strictMode?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions lib/server/v2/WebDAVServerOptions.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var HTTPDigestAuthentication_1 = require("../../user/v2/authentication/HTTPDigestAuthentication");
var FakePrivilegeManager_1 = require("../../user/v2/privilege/FakePrivilegeManager");
var PrivilegeManager_1 = require("../../user/v2/privilege/PrivilegeManager");
var SimpleUserManager_1 = require("../../user/v2/simple/SimpleUserManager");
var VirtualFileSystem_1 = require("../../manager/v2/instances/VirtualFileSystem");
var WebDAVServerOptions = (function () {
function WebDAVServerOptions() {
this.requireAuthentification = false;
this.httpAuthentication = new HTTPDigestAuthentication_1.HTTPDigestAuthentication(new SimpleUserManager_1.SimpleUserManager(), 'default realm');
this.privilegeManager = new FakePrivilegeManager_1.FakePrivilegeManager();
this.privilegeManager = new PrivilegeManager_1.PrivilegeManager();
this.rootFileSystem = new VirtualFileSystem_1.VirtualFileSystem();
this.lockTimeout = 3600;
this.strictMode = false;
Expand Down
9 changes: 4 additions & 5 deletions src/server/v2/WebDAVServerOptions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { HTTPBasicAuthentication } from '../../user/v2/authentication/HTTPBasicAuthentication'
import { HTTPDigestAuthentication } from '../../user/v2/authentication/HTTPDigestAuthentication'
import { FakePrivilegeManager } from '../../user/v2/privilege/FakePrivilegeManager'
import { HTTPAuthentication } from '../../user/v2/authentication/HTTPAuthentication'
import { Writable, Readable } from 'stream'
import { IPrivilegeManager } from '../../user/v2/privilege/IPrivilegeManager'
import { PrivilegeManager } from '../../user/v2/privilege/PrivilegeManager'
import { SimpleUserManager } from '../../user/v2/simple/SimpleUserManager'
import { RootResource } from '../../resource/std/RootResource'
import { IUserManager } from '../../user/v2/IUserManager'
Expand All @@ -15,14 +14,14 @@ import * as https from 'https'
export interface IAutoSave
{
treeFilePath : string,
tempTreeFilePath : string,
tempTreeFilePath ?: string,
onSaveError ?: (error : Error) => void,
streamProvider ?: (inputStream : Writable, callback : (outputStream ?: Writable) => void) => void
}

export interface IAutoLoad
{
treeFilePath : string,
treeFilePath ?: string,
serializers ?: FileSystemSerializer[],
streamProvider ?: (inputStream : Readable, callback : (outputStream ?: Readable) => void) => void
}
Expand All @@ -31,7 +30,7 @@ export class WebDAVServerOptions
{
requireAuthentification ?: boolean = false
httpAuthentication ?: HTTPAuthentication = new HTTPDigestAuthentication(new SimpleUserManager(), 'default realm')
privilegeManager ?: IPrivilegeManager = new FakePrivilegeManager()
privilegeManager ?: PrivilegeManager = new PrivilegeManager()
rootFileSystem ?: FileSystem = new VirtualFileSystem()
lockTimeout ?: number = 3600
strictMode ?: boolean = false
Expand Down

0 comments on commit 386f04a

Please sign in to comment.