1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +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:
renovate[bot]
2023-11-29 16:15:20 -05:00
committed by GitHub
parent 4ff5f38e89
commit 28de9439be
1145 changed files with 5898 additions and 5612 deletions

View File

@@ -8,7 +8,7 @@ export abstract class PasswordGenerationServiceAbstraction {
generatePassphrase: (options: PasswordGeneratorOptions) => Promise<string>;
getOptions: () => Promise<[PasswordGeneratorOptions, PasswordGeneratorPolicyOptions]>;
enforcePasswordGeneratorPoliciesOnOptions: (
options: PasswordGeneratorOptions
options: PasswordGeneratorOptions,
) => Promise<[PasswordGeneratorOptions, PasswordGeneratorPolicyOptions]>;
getPasswordGeneratorPolicyOptions: () => Promise<PasswordGeneratorPolicyOptions>;
saveOptions: (options: PasswordGeneratorOptions) => Promise<void>;
@@ -17,6 +17,6 @@ export abstract class PasswordGenerationServiceAbstraction {
clear: (userId?: string) => Promise<void>;
normalizeOptions: (
options: PasswordGeneratorOptions,
enforcedPolicyOptions: PasswordGeneratorPolicyOptions
enforcedPolicyOptions: PasswordGeneratorPolicyOptions,
) => void;
}

View File

@@ -34,7 +34,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
constructor(
private cryptoService: CryptoService,
private policyService: PolicyService,
private stateService: StateService
private stateService: StateService,
) {}
async generatePassword(options: PasswordGeneratorOptions): Promise<string> {
@@ -190,7 +190,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
}
async enforcePasswordGeneratorPoliciesOnOptions(
options: PasswordGeneratorOptions
options: PasswordGeneratorOptions,
): Promise<[PasswordGeneratorOptions, PasswordGeneratorPolicyOptions]> {
let enforcedPolicyOptions = await this.getPasswordGeneratorPolicyOptions();
if (enforcedPolicyOptions != null) {
@@ -387,7 +387,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
normalizeOptions(
options: PasswordGeneratorOptions,
enforcedPolicyOptions: PasswordGeneratorPolicyOptions
enforcedPolicyOptions: PasswordGeneratorPolicyOptions,
) {
options.minLowercase = 0;
options.minUppercase = 0;
@@ -461,7 +461,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
}
private async encryptHistory(
history: GeneratedPasswordHistory[]
history: GeneratedPasswordHistory[],
): Promise<GeneratedPasswordHistory[]> {
if (history == null || history.length === 0) {
return Promise.resolve([]);
@@ -476,7 +476,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
}
private async decryptHistory(
history: GeneratedPasswordHistory[]
history: GeneratedPasswordHistory[],
): Promise<GeneratedPasswordHistory[]> {
if (history == null || history.length === 0) {
return Promise.resolve([]);

View File

@@ -33,7 +33,7 @@ export class UsernameGenerationService implements UsernameGenerationServiceAbstr
constructor(
private cryptoService: CryptoService,
private stateService: StateService,
private apiService: ApiService
private apiService: ApiService,
) {}
generateUsername(options: UsernameGeneratorOptions): Promise<string> {

View File

@@ -12,7 +12,7 @@ export class PasswordStrengthService implements PasswordStrengthServiceAbstracti
getPasswordStrength(
password: string,
emailInput: string = null,
userInputs: string[] = null
userInputs: string[] = null,
): zxcvbn.ZXCVBNResult {
if (password == null || password.length === 0) {
return null;

View File

@@ -32,7 +32,7 @@ export class SendAccess extends Domain {
expirationDate: null,
creatorIdentifier: null,
},
["id", "expirationDate", "creatorIdentifier"]
["id", "expirationDate", "creatorIdentifier"],
);
this.type = obj.type;
@@ -58,7 +58,7 @@ export class SendAccess extends Domain {
name: null,
},
null,
key
key,
);
switch (this.type) {

View File

@@ -27,7 +27,7 @@ export class SendFile extends Domain {
sizeName: null,
fileName: null,
},
["id", "sizeName"]
["id", "sizeName"],
);
}
@@ -38,7 +38,7 @@ export class SendFile extends Domain {
fileName: null,
},
null,
key
key,
);
return view;
}

View File

@@ -23,7 +23,7 @@ export class SendText extends Domain {
{
text: null,
},
[]
[],
);
}
@@ -34,7 +34,7 @@ export class SendText extends Domain {
text: null,
},
null,
key
key,
);
}

View File

@@ -44,7 +44,7 @@ export class Send extends Domain {
notes: null,
key: null,
},
["id", "accessId"]
["id", "accessId"],
);
this.type = obj.type;
@@ -88,7 +88,7 @@ export class Send extends Domain {
notes: null,
},
null,
model.cryptoKey
model.cryptoKey,
);
switch (this.type) {

View File

@@ -72,7 +72,7 @@ export class SendView implements View {
{ ...this },
{
key: Utils.fromBufferToB64(this.key),
}
},
);
}

View File

@@ -14,7 +14,7 @@ export abstract class SendApiService {
postSendAccess: (
id: string,
request: SendAccessRequest,
apiUrl?: string
apiUrl?: string,
) => Promise<SendAccessResponse>;
getSends: () => Promise<ListResponse<SendResponse>>;
postSend: (request: SendRequest) => Promise<SendResponse>;
@@ -31,7 +31,7 @@ export abstract class SendApiService {
getSendFileDownloadData: (
send: SendAccessView,
request: SendAccessRequest,
apiUrl?: string
apiUrl?: string,
) => Promise<SendFileDownloadDataResponse>;
renewSendFileUploadUrl: (sendId: string, fileId: string) => Promise<SendFileUploadDataResponse>;
removePassword: (id: string) => Promise<any>;

View File

@@ -25,7 +25,7 @@ export class SendApiService implements SendApiServiceAbstraction {
constructor(
private apiService: ApiService,
private fileUploadService: FileUploadService,
private sendService: InternalSendService
private sendService: InternalSendService,
) {}
async getSend(id: string): Promise<SendResponse> {
@@ -36,7 +36,7 @@ export class SendApiService implements SendApiServiceAbstraction {
async postSendAccess(
id: string,
request: SendAccessRequest,
apiUrl?: string
apiUrl?: string,
): Promise<SendAccessResponse> {
const addSendIdHeader = (headers: Headers) => {
headers.set("Send-Id", id);
@@ -48,7 +48,7 @@ export class SendApiService implements SendApiServiceAbstraction {
false,
true,
apiUrl,
addSendIdHeader
addSendIdHeader,
);
return new SendAccessResponse(r);
}
@@ -56,7 +56,7 @@ export class SendApiService implements SendApiServiceAbstraction {
async getSendFileDownloadData(
send: SendAccessView,
request: SendAccessRequest,
apiUrl?: string
apiUrl?: string,
): Promise<SendFileDownloadDataResponse> {
const addSendIdHeader = (headers: Headers) => {
headers.set("Send-Id", send.id);
@@ -68,7 +68,7 @@ export class SendApiService implements SendApiServiceAbstraction {
false,
true,
apiUrl,
addSendIdHeader
addSendIdHeader,
);
return new SendFileDownloadDataResponse(r);
}
@@ -90,14 +90,14 @@ export class SendApiService implements SendApiServiceAbstraction {
async renewSendFileUploadUrl(
sendId: string,
fileId: string
fileId: string,
): Promise<SendFileUploadDataResponse> {
const r = await this.apiService.send(
"GET",
"/sends/" + sendId + "/file/" + fileId,
null,
true,
true
true,
);
return new SendFileUploadDataResponse(r);
}
@@ -126,7 +126,7 @@ export class SendApiService implements SendApiServiceAbstraction {
"/sends/" + id + "/remove-password",
null,
true,
true
true,
);
return new SendResponse(r);
}
@@ -169,7 +169,7 @@ export class SendApiService implements SendApiServiceAbstraction {
uploadDataResponse,
sendData[0].file.fileName,
sendData[1],
this.generateMethods(uploadDataResponse, response)
this.generateMethods(uploadDataResponse, response),
);
} catch (e) {
if (e instanceof ErrorResponse && (e as ErrorResponse).statusCode === 404) {
@@ -191,7 +191,7 @@ export class SendApiService implements SendApiServiceAbstraction {
private generateMethods(
uploadData: SendFileUploadDataResponse,
response: SendResponse
response: SendResponse,
): FileUploadApiMethods {
return {
postDirect: this.generatePostDirectCallback(response),
@@ -225,7 +225,7 @@ export class SendApiService implements SendApiServiceAbstraction {
*/
async legacyServerSendFileUpload(
sendData: [Send, EncArrayBuffer],
request: SendRequest
request: SendRequest,
): Promise<SendResponse> {
const fd = new FormData();
try {
@@ -241,7 +241,7 @@ export class SendApiService implements SendApiServiceAbstraction {
{
filepath: sendData[0].file.fileName.encryptedString,
contentType: "application/octet-stream",
} as any
} as any,
);
} else {
throw e;

View File

@@ -14,7 +14,7 @@ export abstract class SendService {
model: SendView,
file: File | ArrayBuffer,
password: string,
key?: SymmetricCryptoKey
key?: SymmetricCryptoKey,
) => Promise<[Send, EncArrayBuffer]>;
get: (id: string) => Send;
/**

View File

@@ -29,7 +29,7 @@ export class SendService implements InternalSendServiceAbstraction {
private cryptoService: CryptoService,
private i18nService: I18nService,
private cryptoFunctionService: CryptoFunctionService,
private stateService: StateService
private stateService: StateService,
) {
this.stateService.activeAccountUnlocked$
.pipe(
@@ -47,7 +47,7 @@ export class SendService implements InternalSendServiceAbstraction {
const data = await this.stateService.getEncryptedSends();
await this.updateObservables(data);
})
}),
)
.subscribe();
}
@@ -60,7 +60,7 @@ export class SendService implements InternalSendServiceAbstraction {
model: SendView,
file: File | ArrayBuffer,
password: string,
key?: SymmetricCryptoKey
key?: SymmetricCryptoKey,
): Promise<[Send, EncArrayBuffer]> {
let fileData: EncArrayBuffer = null;
const send = new Send();
@@ -78,7 +78,7 @@ export class SendService implements InternalSendServiceAbstraction {
password,
model.key,
"sha256",
SEND_KDF_ITERATIONS
SEND_KDF_ITERATIONS,
);
send.password = Utils.fromBufferToB64(passwordHash);
}
@@ -96,7 +96,7 @@ export class SendService implements InternalSendServiceAbstraction {
const [name, data] = await this.encryptFileData(
model.file.fileName,
file,
model.cryptoKey
model.cryptoKey,
);
send.file.fileName = name;
fileData = data;
@@ -221,7 +221,7 @@ export class SendService implements InternalSendServiceAbstraction {
const [name, data] = await this.encryptFileData(
file.name,
evt.target.result as ArrayBuffer,
key
key,
);
send.file.fileName = name;
resolve(data);
@@ -238,7 +238,7 @@ export class SendService implements InternalSendServiceAbstraction {
private async encryptFileData(
fileName: string,
data: ArrayBuffer,
key: SymmetricCryptoKey
key: SymmetricCryptoKey,
): Promise<[EncString, EncArrayBuffer]> {
const encFileName = await this.cryptoService.encrypt(fileName, key);
const encFileData = await this.cryptoService.encryptToBytes(new Uint8Array(data), key);