forked from bsdz/google-drive-remarkable-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibrary.js
More file actions
23 lines (21 loc) · 1.11 KB
/
Copy pathLibrary.js
File metadata and controls
23 lines (21 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
* Synchronizes PDFs from folder in Google Drive with Remarkable cloud.
*
* @rOneTimeCode {string} one time code from https://my.remarkable.com/connect/mobile.
* @gdFolderSearchParams {string} google folder id or google drive search sdk string.
* @rRootFolder {string} root folder on Remarkable to sync files to - must already exist. This can be a Remarkable GUID if you know it.
* @syncMode {string} either "update" or "mirror". Mirroring removes files on device if they no longer exist in Google Drive.
* @gdSkipFolders {array} list of names of Google Drive folders to skip syncing.
*/
function syncGoogleDriveWithRemarkableCloud(rOneTimeCode, gdFolderSearchParams, rRootFolder, syncMode="update", gdSkipFolders=[]) {
let sync = new Synchronizer(rOneTimeCode, gdFolderSearchParams, rRootFolder, syncMode, gdSkipFolders);
sync.run();
}
/**
* Resets the device id and token forcing reinitialization of Remarkable Cloud authorization.
*/
function resetRemarkableDevice() {
let userProps = PropertiesService.getUserProperties();
userProps.deleteProperty(rDeviceTokenKey);
userProps.deleteProperty(rDeviceIdKey);
}