1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-08 12:40:26 +00:00

revert generate -> generator rename

This commit is contained in:
✨ Audrey ✨
2025-04-23 15:03:54 -04:00
parent e000fd77d4
commit a990419502
8 changed files with 9 additions and 9 deletions

View File

@@ -249,7 +249,7 @@ export class ExportComponent implements OnInit, OnDestroy, AfterViewInit {
}),
);
this.generatorService
.generator$({ on$: this.onGenerate$, account$ })
.generate$({ on$: this.onGenerate$, account$ })
.pipe(takeUntil(this.destroy$))
.subscribe((generated) => {
this.exportForm.patchValue({

View File

@@ -233,7 +233,7 @@ export class CredentialGeneratorComponent implements OnInit, OnChanges, OnDestro
// wire up the generator
this.generatorService
.generator$({
.generate$({
on$: this.generate$.pipe(
tap((g) => this.log.debug(g, "generate request issued by component")),
),

View File

@@ -182,7 +182,7 @@ export class PasswordGeneratorComponent implements OnInit, OnChanges, OnDestroy
// wire up the generator
this.generatorService
.generator$({ on$: this.generate$, account$: this.account$ })
.generate$({ on$: this.generate$, account$: this.account$ })
.pipe(
catchError((error: unknown, generator) => {
if (typeof error === "string") {

View File

@@ -207,7 +207,7 @@ export class UsernameGeneratorComponent implements OnInit, OnChanges, OnDestroy
// wire up the generator
this.generatorService
.generator$({
.generate$({
on$: this.generate$,
account$: this.account$,
})

View File

@@ -26,7 +26,7 @@ export abstract class CredentialGeneratorService {
/** Generates a stream of credentials
* @param dependencies.on$ Required. A new credential is emitted when this emits.
*/
abstract generator$: (
abstract generate$: (
dependencies: OnDependency<GenerateRequest> & BoundDependency<"account", Account>,
) => Observable<GeneratedCredential>;

View File

@@ -112,7 +112,7 @@ describe("DefaultCredentialGeneratorService", () => {
account$: of(account),
};
const result = await firstValueFrom(service.generator$(dependencies));
const result = await firstValueFrom(service.generate$(dependencies));
expect(result).toBe("generatedPassword");
expect(providers.metadata!.metadata).toHaveBeenCalledWith("testAlgorithm");
@@ -141,7 +141,7 @@ describe("DefaultCredentialGeneratorService", () => {
account$: of(account),
};
const result = await firstValueFrom(service.generator$(dependencies));
const result = await firstValueFrom(service.generate$(dependencies));
expect(result).toBe("generatedPassword");
expect(providers.metadata!.metadata).toHaveBeenCalledWith("testAlgorithm");

View File

@@ -47,7 +47,7 @@ export class DefaultCredentialGeneratorService implements CredentialGeneratorSer
private readonly log: SemanticLogger;
generator$(dependencies: OnDependency<GenerateRequest> & BoundDependency<"account", Account>) {
generate$(dependencies: OnDependency<GenerateRequest> & BoundDependency<"account", Account>) {
// `on$` is partitioned into several streams so that the generator
// engine and settings refresh only when their respective inputs change
const on$ = dependencies.on$.pipe(shareReplay({ refCount: true, bufferSize: 1 }));

View File

@@ -127,7 +127,7 @@ export class SendOptionsComponent implements OnInit {
pin({ name: () => "send-options.component", distinct: (p, c) => p.id === c.id }),
);
const generatedCredential = await firstValueFrom(
this.generatorService.generator$({ on$, account$ }),
this.generatorService.generate$({ on$, account$ }),
);
this.sendOptionsForm.patchValue({