feat: Initial clean release of CHM
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
这个提交包含在:
@@ -0,0 +1,100 @@
|
||||
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;
|
||||
userContentPath(): string;
|
||||
username(): string;
|
||||
password(): string;
|
||||
apiKey(): 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 static description() {
|
||||
return _('Joplin\'s own sync service. Also gives access to Joplin-specific features such as publishing notes or collaborating on notebooks with others.');
|
||||
}
|
||||
|
||||
public static supportsSelfHosted(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static supportsRecursiveLinkedNotes(): boolean {
|
||||
// Not currently working:
|
||||
// https://github.com/laurent22/joplin/pull/6661
|
||||
// https://github.com/laurent22/joplin/pull/6600
|
||||
return false;
|
||||
}
|
||||
|
||||
public static override supportsShare(): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
public async isAuthenticated() {
|
||||
try {
|
||||
const fileApi = await this.fileApi();
|
||||
const api = fileApi.driver().api();
|
||||
const sessionId = await api.sessionId();
|
||||
return !!sessionId;
|
||||
} catch (error) {
|
||||
if (error.code === 403) {
|
||||
return false;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
public authRouteName() {
|
||||
return 'JoplinCloudLogin';
|
||||
}
|
||||
|
||||
// While Joplin Cloud requires password, the new login method makes this
|
||||
// information useless
|
||||
public static requiresPassword() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public async fileApi(): Promise<FileApi> {
|
||||
return super.fileApi();
|
||||
}
|
||||
|
||||
public static async checkConfig(options: FileApiOptions) {
|
||||
return SyncTargetJoplinServer.checkConfig({
|
||||
...options,
|
||||
}, SyncTargetJoplinCloud.id());
|
||||
}
|
||||
|
||||
protected async initFileApi() {
|
||||
return initFileApi(SyncTargetJoplinCloud.id(), this.logger(), {
|
||||
path: () => Setting.value('sync.10.path'),
|
||||
userContentPath: () => Setting.value('sync.10.userContentPath'),
|
||||
username: () => Setting.value('sync.10.username'),
|
||||
password: () => Setting.value('sync.10.password'),
|
||||
apiKey: () => Setting.value('sync.10.apiKey'),
|
||||
});
|
||||
}
|
||||
|
||||
protected async initSynchronizer() {
|
||||
return new Synchronizer(this.db(), await this.fileApi(), Setting.value('appType'));
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户