keeweb/app/scripts/storage/index.js

28 lines
924 B
JavaScript
Raw Normal View History

2019-09-15 14:16:32 +02:00
import { Launcher } from 'comp/launcher';
import { StorageCache } from 'storage/impl/storage-cache';
import { StorageDropbox } from 'storage/impl/storage-dropbox';
import { StorageFile } from 'storage/impl/storage-file';
import { StorageFileCache } from 'storage/impl/storage-file-cache';
import { StorageGDrive } from 'storage/impl/storage-gdrive';
import { StorageOneDrive } from 'storage/impl/storage-onedrive';
import { StorageWebDav } from 'storage/impl/storage-webdav';
2015-12-06 21:32:41 +01:00
const BuiltInStorage = {
2019-09-15 13:24:53 +02:00
file: new StorageFile(),
cache: Launcher ? new StorageFileCache() : new StorageCache()
};
const ThirdPartyStorage = {
2019-09-15 13:24:53 +02:00
dropbox: new StorageDropbox(),
gdrive: new StorageGDrive(),
onedrive: new StorageOneDrive(),
webdav: new StorageWebDav()
2015-12-02 21:39:40 +01:00
};
2019-09-15 14:16:32 +02:00
const Storage = BuiltInStorage;
if (!Launcher || Launcher.thirdPartyStoragesSupported) {
2019-09-15 14:16:32 +02:00
_.extend(Storage, ThirdPartyStorage);
2017-02-22 01:35:16 +01:00
}
2019-09-15 14:16:32 +02:00
export { Storage };