mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
[SG-998] and [SG-999] Vault and Autofill team refactor (#4542)
* Move DeprecatedVaultFilterService to vault folder * [libs] move VaultItemsComponent * [libs] move AddEditComponent * [libs] move AddEditCustomFields * [libs] move attachmentsComponent * [libs] folderAddEditComponent * [libs] IconComponent * [libs] PasswordRepormptComponent * [libs] PremiumComponent * [libs] ViewCustomFieldsComponent * [libs] ViewComponent * [libs] PasswordRepromptService * [libs] Move FolderService and FolderApiService abstractions * [libs] FolderService imports * [libs] PasswordHistoryComponent * [libs] move Sync and SyncNotifier abstractions * [libs] SyncService imports * [libs] fix file casing for passwordReprompt abstraction * [libs] SyncNotifier import fix * [libs] CipherServiceAbstraction * [libs] PasswordRepromptService abstraction * [libs] Fix file casing for angular passwordReprompt service * [libs] fix file casing for SyncNotifierService * [libs] CipherRepromptType * [libs] rename CipherRepromptType * [libs] CipherType * [libs] Rename CipherType * [libs] CipherData * [libs] FolderData * [libs] PasswordHistoryData * [libs] AttachmentData * [libs] CardData * [libs] FieldData * [libs] IdentityData * [libs] LocalData * [libs] LoginData * [libs] SecureNoteData * [libs] LoginUriData * [libs] Domain classes * [libs] SecureNote * [libs] Request models * [libs] Response models * [libs] View part 1 * [libs] Views part 2 * [libs] Move folder services * [libs] Views fixes * [libs] Move sync services * [libs] cipher service * [libs] Types * [libs] Sync file casing * [libs] Fix folder service import * [libs] Move spec files * [libs] casing fixes on spec files * [browser] Autofill background, clipboard, commands * [browser] Fix ContextMenusBackground casing * [browser] Rename fix * [browser] Autofill content * [browser] autofill.js * [libs] enpass importer spec fix * [browser] autofill models * [browser] autofill manifest path updates * [browser] Autofill notification files * [browser] autofill services * [browser] Fix file casing * [browser] Vault popup loose components * [browser] Vault components * [browser] Manifest fixes * [browser] Vault services * [cli] vault commands and models * [browser] File capitilization fixes * [desktop] Vault components and services * [web] vault loose components * [web] Vault components * [browser] Fix misc-utils import * [libs] Fix psono spec imports * [fix] Add comments to address lint rules
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
import { FileUploadType } from "../../enums/fileUploadType";
|
||||
|
||||
import { BaseResponse } from "./base.response";
|
||||
import { CipherResponse } from "./cipher.response";
|
||||
|
||||
export class AttachmentUploadDataResponse extends BaseResponse {
|
||||
attachmentId: string;
|
||||
fileUploadType: FileUploadType;
|
||||
cipherResponse: CipherResponse;
|
||||
cipherMiniResponse: CipherResponse;
|
||||
url: string = null;
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.attachmentId = this.getResponseProperty("AttachmentId");
|
||||
this.fileUploadType = this.getResponseProperty("FileUploadType");
|
||||
const cipherResponse = this.getResponseProperty("CipherResponse");
|
||||
const cipherMiniResponse = this.getResponseProperty("CipherMiniResponse");
|
||||
this.cipherResponse = cipherResponse == null ? null : new CipherResponse(cipherResponse);
|
||||
this.cipherMiniResponse =
|
||||
cipherMiniResponse == null ? null : new CipherResponse(cipherMiniResponse);
|
||||
this.url = this.getResponseProperty("Url");
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { BaseResponse } from "./base.response";
|
||||
|
||||
export class AttachmentResponse extends BaseResponse {
|
||||
id: string;
|
||||
url: string;
|
||||
fileName: string;
|
||||
key: string;
|
||||
size: string;
|
||||
sizeName: string;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.id = this.getResponseProperty("Id");
|
||||
this.url = this.getResponseProperty("Url");
|
||||
this.fileName = this.getResponseProperty("FileName");
|
||||
this.key = this.getResponseProperty("Key");
|
||||
this.size = this.getResponseProperty("Size");
|
||||
this.sizeName = this.getResponseProperty("SizeName");
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
import { CipherRepromptType } from "../../enums/cipherRepromptType";
|
||||
import { CardApi } from "../api/card.api";
|
||||
import { FieldApi } from "../api/field.api";
|
||||
import { IdentityApi } from "../api/identity.api";
|
||||
import { LoginApi } from "../api/login.api";
|
||||
import { SecureNoteApi } from "../api/secure-note.api";
|
||||
|
||||
import { AttachmentResponse } from "./attachment.response";
|
||||
import { BaseResponse } from "./base.response";
|
||||
import { PasswordHistoryResponse } from "./password-history.response";
|
||||
|
||||
export class CipherResponse extends BaseResponse {
|
||||
id: string;
|
||||
organizationId: string;
|
||||
folderId: string;
|
||||
type: number;
|
||||
name: string;
|
||||
notes: string;
|
||||
fields: FieldApi[];
|
||||
login: LoginApi;
|
||||
card: CardApi;
|
||||
identity: IdentityApi;
|
||||
secureNote: SecureNoteApi;
|
||||
favorite: boolean;
|
||||
edit: boolean;
|
||||
viewPassword: boolean;
|
||||
organizationUseTotp: boolean;
|
||||
revisionDate: string;
|
||||
attachments: AttachmentResponse[];
|
||||
passwordHistory: PasswordHistoryResponse[];
|
||||
collectionIds: string[];
|
||||
creationDate: string;
|
||||
deletedDate: string;
|
||||
reprompt: CipherRepromptType;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.id = this.getResponseProperty("Id");
|
||||
this.organizationId = this.getResponseProperty("OrganizationId");
|
||||
this.folderId = this.getResponseProperty("FolderId") || null;
|
||||
this.type = this.getResponseProperty("Type");
|
||||
this.name = this.getResponseProperty("Name");
|
||||
this.notes = this.getResponseProperty("Notes");
|
||||
this.favorite = this.getResponseProperty("Favorite") || false;
|
||||
this.edit = !!this.getResponseProperty("Edit");
|
||||
if (this.getResponseProperty("ViewPassword") == null) {
|
||||
this.viewPassword = true;
|
||||
} else {
|
||||
this.viewPassword = this.getResponseProperty("ViewPassword");
|
||||
}
|
||||
this.organizationUseTotp = this.getResponseProperty("OrganizationUseTotp");
|
||||
this.revisionDate = this.getResponseProperty("RevisionDate");
|
||||
this.collectionIds = this.getResponseProperty("CollectionIds");
|
||||
this.creationDate = this.getResponseProperty("CreationDate");
|
||||
this.deletedDate = this.getResponseProperty("DeletedDate");
|
||||
|
||||
const login = this.getResponseProperty("Login");
|
||||
if (login != null) {
|
||||
this.login = new LoginApi(login);
|
||||
}
|
||||
|
||||
const card = this.getResponseProperty("Card");
|
||||
if (card != null) {
|
||||
this.card = new CardApi(card);
|
||||
}
|
||||
|
||||
const identity = this.getResponseProperty("Identity");
|
||||
if (identity != null) {
|
||||
this.identity = new IdentityApi(identity);
|
||||
}
|
||||
|
||||
const secureNote = this.getResponseProperty("SecureNote");
|
||||
if (secureNote != null) {
|
||||
this.secureNote = new SecureNoteApi(secureNote);
|
||||
}
|
||||
|
||||
const fields = this.getResponseProperty("Fields");
|
||||
if (fields != null) {
|
||||
this.fields = fields.map((f: any) => new FieldApi(f));
|
||||
}
|
||||
|
||||
const attachments = this.getResponseProperty("Attachments");
|
||||
if (attachments != null) {
|
||||
this.attachments = attachments.map((a: any) => new AttachmentResponse(a));
|
||||
}
|
||||
|
||||
const passwordHistory = this.getResponseProperty("PasswordHistory");
|
||||
if (passwordHistory != null) {
|
||||
this.passwordHistory = passwordHistory.map((h: any) => new PasswordHistoryResponse(h));
|
||||
}
|
||||
|
||||
this.reprompt = this.getResponseProperty("Reprompt") || CipherRepromptType.None;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import { EmergencyAccessStatusType } from "../../enums/emergencyAccessStatusType";
|
||||
import { EmergencyAccessType } from "../../enums/emergencyAccessType";
|
||||
import { KdfType } from "../../enums/kdfType";
|
||||
import { CipherResponse } from "../../vault/models/response/cipher.response";
|
||||
|
||||
import { BaseResponse } from "./base.response";
|
||||
import { CipherResponse } from "./cipher.response";
|
||||
|
||||
export class EmergencyAccessGranteeDetailsResponse extends BaseResponse {
|
||||
id: string;
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import { BaseResponse } from "./base.response";
|
||||
|
||||
export class FolderResponse extends BaseResponse {
|
||||
id: string;
|
||||
name: string;
|
||||
revisionDate: string;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.id = this.getResponseProperty("Id");
|
||||
this.name = this.getResponseProperty("Name");
|
||||
this.revisionDate = this.getResponseProperty("RevisionDate");
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { CipherResponse } from "../../vault/models/response/cipher.response";
|
||||
|
||||
import { BaseResponse } from "./base.response";
|
||||
import { CipherResponse } from "./cipher.response";
|
||||
import { CollectionResponse } from "./collection.response";
|
||||
|
||||
export class OrganizationExportResponse extends BaseResponse {
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import { BaseResponse } from "./base.response";
|
||||
|
||||
export class PasswordHistoryResponse extends BaseResponse {
|
||||
password: string;
|
||||
lastUsedDate: string;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.password = this.getResponseProperty("Password");
|
||||
this.lastUsedDate = this.getResponseProperty("LastUsedDate");
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
import { BaseResponse } from "./base.response";
|
||||
import { CipherResponse } from "./cipher.response";
|
||||
import { CollectionDetailsResponse } from "./collection.response";
|
||||
import { DomainsResponse } from "./domains.response";
|
||||
import { FolderResponse } from "./folder.response";
|
||||
import { PolicyResponse } from "./policy.response";
|
||||
import { ProfileResponse } from "./profile.response";
|
||||
import { SendResponse } from "./send.response";
|
||||
|
||||
export class SyncResponse extends BaseResponse {
|
||||
profile?: ProfileResponse;
|
||||
folders: FolderResponse[] = [];
|
||||
collections: CollectionDetailsResponse[] = [];
|
||||
ciphers: CipherResponse[] = [];
|
||||
domains?: DomainsResponse;
|
||||
policies?: PolicyResponse[] = [];
|
||||
sends: SendResponse[] = [];
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
|
||||
const profile = this.getResponseProperty("Profile");
|
||||
if (profile != null) {
|
||||
this.profile = new ProfileResponse(profile);
|
||||
}
|
||||
|
||||
const folders = this.getResponseProperty("Folders");
|
||||
if (folders != null) {
|
||||
this.folders = folders.map((f: any) => new FolderResponse(f));
|
||||
}
|
||||
|
||||
const collections = this.getResponseProperty("Collections");
|
||||
if (collections != null) {
|
||||
this.collections = collections.map((c: any) => new CollectionDetailsResponse(c));
|
||||
}
|
||||
|
||||
const ciphers = this.getResponseProperty("Ciphers");
|
||||
if (ciphers != null) {
|
||||
this.ciphers = ciphers.map((c: any) => new CipherResponse(c));
|
||||
}
|
||||
|
||||
const domains = this.getResponseProperty("Domains");
|
||||
if (domains != null) {
|
||||
this.domains = new DomainsResponse(domains);
|
||||
}
|
||||
|
||||
const policies = this.getResponseProperty("Policies");
|
||||
if (policies != null) {
|
||||
this.policies = policies.map((p: any) => new PolicyResponse(p));
|
||||
}
|
||||
|
||||
const sends = this.getResponseProperty("Sends");
|
||||
if (sends != null) {
|
||||
this.sends = sends.map((s: any) => new SendResponse(s));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user