mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
[deps] Autofill: Update prettier to v3 (#7014)
* [deps] Autofill: Update prettier to v3 * prettier formatting updates --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
This commit is contained in:
@@ -18,7 +18,7 @@ export class SendCreateCommand {
|
||||
private sendService: SendService,
|
||||
private stateService: StateService,
|
||||
private environmentService: EnvironmentService,
|
||||
private sendApiService: SendApiService
|
||||
private sendApiService: SendApiService,
|
||||
) {}
|
||||
|
||||
async run(requestJson: any, cmdOptions: Record<string, any>) {
|
||||
@@ -78,7 +78,7 @@ export class SendCreateCommand {
|
||||
case SendType.File:
|
||||
if (process.env.BW_SERVE === "true") {
|
||||
return Response.error(
|
||||
"Creating a file-based Send is unsupported through the `serve` command at this time."
|
||||
"Creating a file-based Send is unsupported through the `serve` command at this time.",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ export class SendCreateCommand {
|
||||
|
||||
if (filePath == null) {
|
||||
return Response.badRequest(
|
||||
"Must specify a file to Send either with the --file option or in the request JSON."
|
||||
"Must specify a file to Send either with the --file option or in the request JSON.",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ export class SendCreateCommand {
|
||||
case SendType.Text:
|
||||
if (text == null) {
|
||||
return Response.badRequest(
|
||||
"Must specify text content to Send either with the --text option or in the request JSON."
|
||||
"Must specify text content to Send either with the --text option or in the request JSON.",
|
||||
);
|
||||
}
|
||||
req.text = new SendTextResponse();
|
||||
@@ -106,7 +106,7 @@ export class SendCreateCommand {
|
||||
break;
|
||||
default:
|
||||
return Response.badRequest(
|
||||
"Unknown Send type " + SendType[req.type] + ". Valid types are: file, text"
|
||||
"Unknown Send type " + SendType[req.type] + ". Valid types are: file, text",
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,10 @@ import { SendService } from "@bitwarden/common/tools/send/services/send.service.
|
||||
import { Response } from "../../../models/response";
|
||||
|
||||
export class SendDeleteCommand {
|
||||
constructor(private sendService: SendService, private sendApiService: SendApiService) {}
|
||||
constructor(
|
||||
private sendService: SendService,
|
||||
private sendApiService: SendApiService,
|
||||
) {}
|
||||
|
||||
async run(id: string) {
|
||||
const send = await this.sendService.getFromState(id);
|
||||
|
||||
@@ -14,7 +14,7 @@ export class SendEditCommand {
|
||||
private sendService: SendService,
|
||||
private stateService: StateService,
|
||||
private getCommand: SendGetCommand,
|
||||
private sendApiService: SendApiService
|
||||
private sendApiService: SendApiService,
|
||||
) {}
|
||||
|
||||
async run(requestJson: string, cmdOptions: Record<string, any>): Promise<Response> {
|
||||
|
||||
@@ -16,7 +16,7 @@ export class SendGetCommand extends DownloadCommand {
|
||||
private sendService: SendService,
|
||||
private environmentService: EnvironmentService,
|
||||
private searchService: SearchService,
|
||||
cryptoService: CryptoService
|
||||
cryptoService: CryptoService,
|
||||
) {
|
||||
super(cryptoService);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export class SendListCommand {
|
||||
constructor(
|
||||
private sendService: SendService,
|
||||
private environmentService: EnvironmentService,
|
||||
private searchService: SearchService
|
||||
private searchService: SearchService,
|
||||
) {}
|
||||
|
||||
async run(cmdOptions: Record<string, any>): Promise<Response> {
|
||||
|
||||
@@ -31,7 +31,7 @@ export class SendReceiveCommand extends DownloadCommand {
|
||||
private cryptoFunctionService: CryptoFunctionService,
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private environmentService: EnvironmentService,
|
||||
private sendApiService: SendApiService
|
||||
private sendApiService: SendApiService,
|
||||
) {
|
||||
super(cryptoService);
|
||||
}
|
||||
@@ -89,13 +89,13 @@ export class SendReceiveCommand extends DownloadCommand {
|
||||
const downloadData = await this.sendApiService.getSendFileDownloadData(
|
||||
response,
|
||||
this.sendAccessRequest,
|
||||
apiUrl
|
||||
apiUrl,
|
||||
);
|
||||
return await this.saveAttachmentToFile(
|
||||
downloadData.url,
|
||||
this.decKey,
|
||||
response?.file?.fileName,
|
||||
options.output
|
||||
options.output,
|
||||
);
|
||||
}
|
||||
default:
|
||||
@@ -126,7 +126,7 @@ export class SendReceiveCommand extends DownloadCommand {
|
||||
password,
|
||||
keyArray,
|
||||
"sha256",
|
||||
100000
|
||||
100000,
|
||||
);
|
||||
return Utils.fromBufferToB64(passwordHash);
|
||||
}
|
||||
@@ -134,13 +134,13 @@ export class SendReceiveCommand extends DownloadCommand {
|
||||
private async sendRequest(
|
||||
url: string,
|
||||
id: string,
|
||||
key: Uint8Array
|
||||
key: Uint8Array,
|
||||
): Promise<Response | SendAccessView> {
|
||||
try {
|
||||
const sendResponse = await this.sendApiService.postSendAccess(
|
||||
id,
|
||||
this.sendAccessRequest,
|
||||
url
|
||||
url,
|
||||
);
|
||||
|
||||
const sendAccess = new SendAccess(sendResponse);
|
||||
|
||||
@@ -5,7 +5,10 @@ import { Response } from "../../../models/response";
|
||||
import { SendResponse } from "../models/send.response";
|
||||
|
||||
export class SendRemovePasswordCommand {
|
||||
constructor(private sendService: SendService, private sendApiService: SendApiService) {}
|
||||
constructor(
|
||||
private sendService: SendService,
|
||||
private sendApiService: SendApiService,
|
||||
) {}
|
||||
|
||||
async run(id: string) {
|
||||
try {
|
||||
|
||||
@@ -46,24 +46,24 @@ export class SendProgram extends Program {
|
||||
"Work with Bitwarden sends. A Send can be quickly created using this command or subcommands can be used to fine-tune the Send",
|
||||
{
|
||||
data: "The data to Send. Specify as a filepath with the --file option",
|
||||
}
|
||||
},
|
||||
)
|
||||
.option("-f, --file", "Specifies that <data> is a filepath")
|
||||
.option(
|
||||
"-d, --deleteInDays <days>",
|
||||
"The number of days in the future to set deletion date, defaults to 7",
|
||||
"7"
|
||||
"7",
|
||||
)
|
||||
.option("-a, --maxAccessCount <amount>", "The amount of max possible accesses.")
|
||||
.option("--hidden", "Hide <data> in web by default. Valid only if --file is not set.")
|
||||
.option(
|
||||
"-n, --name <name>",
|
||||
"The name of the Send. Defaults to a guid for text Sends and the filename for files."
|
||||
"The name of the Send. Defaults to a guid for text Sends and the filename for files.",
|
||||
)
|
||||
.option("--notes <notes>", "Notes to add to the Send.")
|
||||
.option(
|
||||
"--fullObject",
|
||||
"Specifies that the full Send object should be returned rather than just the access url."
|
||||
"Specifies that the full Send object should be returned rather than just the access url.",
|
||||
)
|
||||
.addCommand(this.listCommand())
|
||||
.addCommand(this.templateCommand())
|
||||
@@ -95,14 +95,14 @@ export class SendProgram extends Program {
|
||||
.option("--passwordenv <passwordenv>", "Environment variable storing the Send's password")
|
||||
.option(
|
||||
"--passwordfile <passwordfile>",
|
||||
"Path to a file containing the Sends password as its first line"
|
||||
"Path to a file containing the Sends password as its first line",
|
||||
)
|
||||
.option("--obj", "Return the Send's json object rather than the Send's content")
|
||||
.option("--output <location>", "Specify a file path to save a File-type Send to")
|
||||
.on("--help", () => {
|
||||
writeLn("");
|
||||
writeLn(
|
||||
"If a password is required, the provided password is used or the user is prompted."
|
||||
"If a password is required, the provided password is used or the user is prompted.",
|
||||
);
|
||||
writeLn("", true);
|
||||
})
|
||||
@@ -113,7 +113,7 @@ export class SendProgram extends Program {
|
||||
this.main.cryptoFunctionService,
|
||||
this.main.platformUtilsService,
|
||||
this.main.environmentService,
|
||||
this.main.sendApiService
|
||||
this.main.sendApiService,
|
||||
);
|
||||
const response = await cmd.run(url, options);
|
||||
this.processResponse(response);
|
||||
@@ -132,7 +132,7 @@ export class SendProgram extends Program {
|
||||
const cmd = new SendListCommand(
|
||||
this.main.sendService,
|
||||
this.main.environmentService,
|
||||
this.main.searchService
|
||||
this.main.searchService,
|
||||
);
|
||||
const response = await cmd.run(options);
|
||||
this.processResponse(response);
|
||||
@@ -157,7 +157,7 @@ export class SendProgram extends Program {
|
||||
this.main.searchService,
|
||||
this.main.apiService,
|
||||
this.main.organizationService,
|
||||
this.main.eventCollectionService
|
||||
this.main.eventCollectionService,
|
||||
);
|
||||
const response = await cmd.run("template", object, null);
|
||||
this.processResponse(response);
|
||||
@@ -195,7 +195,7 @@ export class SendProgram extends Program {
|
||||
this.main.sendService,
|
||||
this.main.environmentService,
|
||||
this.main.searchService,
|
||||
this.main.cryptoService
|
||||
this.main.cryptoService,
|
||||
);
|
||||
const response = await cmd.run(id, options);
|
||||
this.processResponse(response);
|
||||
@@ -213,7 +213,7 @@ export class SendProgram extends Program {
|
||||
.option("--hidden", "text hidden flag. Valid only with the --text option.")
|
||||
.option(
|
||||
"--password <password>",
|
||||
"optional password to access this Send. Can also be specified in JSON"
|
||||
"optional password to access this Send. Can also be specified in JSON",
|
||||
)
|
||||
.on("--help", () => {
|
||||
writeLn("");
|
||||
@@ -225,7 +225,7 @@ export class SendProgram extends Program {
|
||||
async (
|
||||
encodedJson: string,
|
||||
options: program.OptionValues,
|
||||
args: { parent: program.Command }
|
||||
args: { parent: program.Command },
|
||||
) => {
|
||||
// Work-around to support `--fullObject` option for `send create --fullObject`
|
||||
// Calling `option('--fullObject', ...)` above won't work due to Commander doesn't like same option
|
||||
@@ -238,7 +238,7 @@ export class SendProgram extends Program {
|
||||
|
||||
const response = await this.runCreate(encodedJson, mergedOptions);
|
||||
this.processResponse(response);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -262,13 +262,13 @@ export class SendProgram extends Program {
|
||||
this.main.sendService,
|
||||
this.main.environmentService,
|
||||
this.main.searchService,
|
||||
this.main.cryptoService
|
||||
this.main.cryptoService,
|
||||
);
|
||||
const cmd = new SendEditCommand(
|
||||
this.main.sendService,
|
||||
this.main.stateService,
|
||||
getCmd,
|
||||
this.main.sendApiService
|
||||
this.main.sendApiService,
|
||||
);
|
||||
const response = await cmd.run(encodedJson, options);
|
||||
this.processResponse(response);
|
||||
@@ -338,7 +338,7 @@ export class SendProgram extends Program {
|
||||
this.main.sendService,
|
||||
this.main.stateService,
|
||||
this.main.environmentService,
|
||||
this.main.sendApiService
|
||||
this.main.sendApiService,
|
||||
);
|
||||
return await cmd.run(encodedJson, options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user