forked from acaldas/document-model-electron
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove default drives info from connect + add default drives to…
… reactor config
- Loading branch information
Showing
10 changed files
with
304 additions
and
204 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { DocumentDriveServerOptions } from 'document-drive/server'; | ||
|
||
const DEFAULT_DRIVES_URL = import.meta.env.VITE_DEFAULT_DRIVES_URL || undefined; | ||
const defaultDrivesUrl = DEFAULT_DRIVES_URL?.split(','); | ||
|
||
export const getReactorDefaultDrivesConfig = (): Pick< | ||
DocumentDriveServerOptions, | ||
'defaultRemoteDrives' | 'removeOldRemoteDrives' | ||
> => { | ||
const defaultDrives: DocumentDriveServerOptions['defaultRemoteDrives'] = | ||
defaultDrivesUrl?.map(driveUrl => ({ | ||
url: driveUrl, | ||
options: { | ||
sharingType: 'PUBLIC', | ||
availableOffline: true, | ||
listeners: [ | ||
{ | ||
block: true, | ||
callInfo: { | ||
data: driveUrl, | ||
name: 'switchboard-push', | ||
transmitterType: 'SwitchboardPush', | ||
}, | ||
filter: { | ||
branch: ['main'], | ||
documentId: ['*'], | ||
documentType: ['*'], | ||
scope: ['global'], | ||
}, | ||
label: 'Switchboard Sync', | ||
listenerId: '1', | ||
system: true, | ||
}, | ||
], | ||
triggers: [], | ||
pullInterval: 3000, | ||
}, | ||
})); | ||
|
||
return { | ||
defaultRemoteDrives: defaultDrives, | ||
removeOldRemoteDrives: { | ||
strategy: 'preserve-by-url', | ||
urls: defaultDrivesUrl || [], | ||
}, | ||
}; | ||
}; |