mirror of
https://github.com/bitwarden/jslib
synced 2025-12-16 08:13:26 +00:00
CLI specifies bitwarden api for send download (#348)
This is needed for CLI to download Send files from non-configured Bitwarden Servers. Web does not have this issue because it can assume api from its own url.
This commit is contained in:
@@ -192,7 +192,7 @@ export abstract class ApiService {
|
|||||||
putSend: (id: string, request: SendRequest) => Promise<SendResponse>;
|
putSend: (id: string, request: SendRequest) => Promise<SendResponse>;
|
||||||
putSendRemovePassword: (id: string) => Promise<SendResponse>;
|
putSendRemovePassword: (id: string) => Promise<SendResponse>;
|
||||||
deleteSend: (id: string) => Promise<any>;
|
deleteSend: (id: string) => Promise<any>;
|
||||||
getSendFileDownloadData: (send: SendAccessView, request: SendAccessRequest) => Promise<SendFileDownloadDataResponse>;
|
getSendFileDownloadData: (send: SendAccessView, request: SendAccessRequest, apiUrl?: string) => Promise<SendFileDownloadDataResponse>;
|
||||||
renewSendFileUploadUrl: (sendId: string, fileId: string) => Promise<SendFileUploadDataResponse>;
|
renewSendFileUploadUrl: (sendId: string, fileId: string) => Promise<SendFileUploadDataResponse>;
|
||||||
|
|
||||||
getCipher: (id: string) => Promise<CipherResponse>;
|
getCipher: (id: string) => Promise<CipherResponse>;
|
||||||
|
|||||||
@@ -423,8 +423,8 @@ export class ApiService implements ApiServiceAbstraction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async getSendFileDownloadData(send: SendAccessView, request: SendAccessRequest): Promise<SendFileDownloadDataResponse> {
|
async getSendFileDownloadData(send: SendAccessView, request: SendAccessRequest, apiUrl?: string): Promise<SendFileDownloadDataResponse> {
|
||||||
const r = await this.send('POST', '/sends/' + send.id + '/access/file/' + send.file.id, request, false, true);
|
const r = await this.send('POST', '/sends/' + send.id + '/access/file/' + send.file.id, request, false, true, apiUrl);
|
||||||
return new SendFileDownloadDataResponse(r);
|
return new SendFileDownloadDataResponse(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user