-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Desktop: Add Joplin Cloud sync target
- Loading branch information
Showing
11 changed files
with
151 additions
and
33 deletions.
There are no files selected for viewing
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 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,57 @@ | ||
import Setting from './models/Setting'; | ||
import Synchronizer from './Synchronizer'; | ||
import { _ } from './locale.js'; | ||
import BaseSyncTarget from './BaseSyncTarget'; | ||
import { FileApi } from './file-api'; | ||
import SyncTargetJoplinServer, { initFileApi } from './SyncTargetJoplinServer'; | ||
|
||
interface FileApiOptions { | ||
path(): string; | ||
username(): string; | ||
password(): string; | ||
} | ||
|
||
export default class SyncTargetJoplinCloud extends BaseSyncTarget { | ||
|
||
public static id() { | ||
return 10; | ||
} | ||
|
||
public static supportsConfigCheck() { | ||
return SyncTargetJoplinServer.supportsConfigCheck(); | ||
} | ||
|
||
public static targetName() { | ||
return 'joplinCloud'; | ||
} | ||
|
||
public static label() { | ||
return _('Joplin Cloud'); | ||
} | ||
|
||
public async isAuthenticated() { | ||
return true; | ||
} | ||
|
||
public async fileApi(): Promise<FileApi> { | ||
return super.fileApi(); | ||
} | ||
|
||
public static async checkConfig(options: FileApiOptions) { | ||
return SyncTargetJoplinServer.checkConfig({ | ||
...options, | ||
}); | ||
} | ||
|
||
protected async initFileApi() { | ||
return initFileApi(this.logger(), { | ||
path: () => Setting.value('sync.10.path'), | ||
username: () => Setting.value('sync.10.username'), | ||
password: () => Setting.value('sync.10.password'), | ||
}); | ||
} | ||
|
||
protected async initSynchronizer() { | ||
return new Synchronizer(this.db(), await this.fileApi(), Setting.value('appType')); | ||
} | ||
} |
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 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
21ea325
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between Joplin Server and Joplin Cloud?
21ea325
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Joplin Server is the server that can be hosted anywhere, and Joplin Cloud is the service that will be a hosted on a specific domain.
21ea325
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info.