mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-19 17:13:31 -04:00
refactor: support new Autumn url scheme
This commit is contained in:
+18
-7
@@ -59,19 +59,30 @@ export class File {
|
||||
/**
|
||||
* Direct URL to the file
|
||||
*/
|
||||
get url(): string {
|
||||
return `${this.#client.configuration?.features.autumn.url}/${this.tag}/${
|
||||
this.id
|
||||
}/${this.filename}`;
|
||||
// get url(): string {
|
||||
// if (!this.filename) return this.previewUrl;
|
||||
//
|
||||
// return `${this.#client.configuration?.features.autumn.url}/${this.tag}/${
|
||||
// this.id
|
||||
// }/${this.filename}`;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Preview URL for the file
|
||||
*/
|
||||
get previewUrl(): string {
|
||||
return `${this.#client.configuration?.features.autumn.url}/${
|
||||
this.tag
|
||||
}/${this.id}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Download URL for the file
|
||||
* Original download URL for the file
|
||||
*/
|
||||
get downloadURL(): string {
|
||||
get originalUrl(): string {
|
||||
return `${this.#client.configuration?.features.autumn.url}/${
|
||||
this.tag
|
||||
}/download/${this.id}/${this.filename}`;
|
||||
}/${this.id}/original`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user