feat: add FTP and SFTP upload support

This commit is contained in:
2026-07-12 10:04:21 +08:00
parent f1998fb23c
commit dd12521be2
22 changed files with 1466 additions and 44 deletions
+33
View File
@@ -179,6 +179,36 @@ export namespace domain {
return a;
}
}
export class FTPConfig {
protocol: string;
host: string;
port: number;
user: string;
authMethod: string;
password: string;
pathPrefix: string;
strictHostKey: boolean;
knownHostsPath: string;
connectTimeoutSecs: number;
static createFrom(source: any = {}) {
return new FTPConfig(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.protocol = source["protocol"];
this.host = source["host"];
this.port = source["port"];
this.user = source["user"];
this.authMethod = source["authMethod"];
this.password = source["password"];
this.pathPrefix = source["pathPrefix"];
this.strictHostKey = source["strictHostKey"];
this.knownHostsPath = source["knownHostsPath"];
this.connectTimeoutSecs = source["connectTimeoutSecs"];
}
}
export class SSHConfig {
host: string;
port: number;
@@ -238,6 +268,7 @@ export namespace domain {
theme: string;
s3: S3Config;
ssh: SSHConfig;
ftp: FTPConfig;
llm: LLMConfig;
ocr: OCRConfig;
@@ -251,6 +282,7 @@ export namespace domain {
this.theme = source["theme"];
this.s3 = this.convertValues(source["s3"], S3Config);
this.ssh = this.convertValues(source["ssh"], SSHConfig);
this.ftp = this.convertValues(source["ftp"], FTPConfig);
this.llm = this.convertValues(source["llm"], LLMConfig);
this.ocr = this.convertValues(source["ocr"], OCRConfig);
}
@@ -278,6 +310,7 @@ export namespace domain {
}