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';
|
2021-07-11 00:56:51 +02:00
|
|
|
import { StorageTeams } from 'storage/impl/storage-teams';
|
2019-09-15 14:16:32 +02:00
|
|
|
import { StorageWebDav } from 'storage/impl/storage-webdav';
|
2020-04-17 19:42:35 +02:00
|
|
|
import { createOAuthSession } from 'storage/pkce';
|
2015-12-06 21:32:41 +01:00
|
|
|
|
2017-02-20 23:38:52 +01:00
|
|
|
const BuiltInStorage = {
|
2019-09-15 13:24:53 +02:00
|
|
|
file: new StorageFile(),
|
|
|
|
cache: Launcher ? new StorageFileCache() : new StorageCache()
|
2017-02-04 19:31:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const ThirdPartyStorage = {
|
2019-09-15 13:24:53 +02:00
|
|
|
dropbox: new StorageDropbox(),
|
|
|
|
gdrive: new StorageGDrive(),
|
|
|
|
onedrive: new StorageOneDrive(),
|
2021-07-11 16:22:38 +02:00
|
|
|
msteams: new StorageTeams(),
|
2019-09-15 13:24:53 +02:00
|
|
|
webdav: new StorageWebDav()
|
2015-12-02 21:39:40 +01:00
|
|
|
};
|
|
|
|
|
2019-09-15 14:16:32 +02:00
|
|
|
const Storage = BuiltInStorage;
|
2017-04-14 23:22:33 +02:00
|
|
|
if (!Launcher || Launcher.thirdPartyStoragesSupported) {
|
2019-09-17 22:17:40 +02:00
|
|
|
Object.assign(Storage, ThirdPartyStorage);
|
2017-02-22 01:35:16 +01:00
|
|
|
}
|
|
|
|
|
2020-04-17 19:42:35 +02:00
|
|
|
requestAnimationFrame(createOAuthSession);
|
|
|
|
|
2019-09-15 14:16:32 +02:00
|
|
|
export { Storage };
|