mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 03:33:54 +00:00
Fixes for format change of 1pux files (#714)
* Remove unneeded ItemCollection type * Mark item.trashed as optional property * Adjust format of test files to be identical to current exports
This commit is contained in:
committed by
GitHub
parent
67a4fc8591
commit
744649573a
@@ -18,7 +18,6 @@ import {
|
||||
ExportData,
|
||||
FieldsEntity,
|
||||
Item,
|
||||
ItemCollection,
|
||||
LoginFieldTypeEnum,
|
||||
Overview,
|
||||
PasswordHistoryEntity,
|
||||
@@ -38,8 +37,7 @@ export class OnePassword1PuxImporter extends BaseImporter implements Importer {
|
||||
// TODO Add handling of multiple vaults
|
||||
// const personalVaults = account.vaults[0].filter((v) => v.attrs.type === VaultAttributeTypeEnum.Personal);
|
||||
account.vaults.forEach((vault: VaultsEntity) => {
|
||||
vault.items.forEach((itemCollection: ItemCollection) => {
|
||||
const item: Item = itemCollection.item;
|
||||
vault.items.forEach((item: Item) => {
|
||||
if (item.trashed === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface AccountAttributes {
|
||||
}
|
||||
export interface VaultsEntity {
|
||||
attrs: VaultAttributes;
|
||||
items?: ItemCollection[] | null;
|
||||
items?: Item[] | null;
|
||||
}
|
||||
export interface VaultAttributes {
|
||||
uuid: string;
|
||||
@@ -24,9 +24,6 @@ export interface VaultAttributes {
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
export interface ItemCollection {
|
||||
item: Item;
|
||||
}
|
||||
|
||||
export enum CategoryEnum {
|
||||
Login = "001",
|
||||
@@ -56,7 +53,7 @@ export interface Item {
|
||||
favIndex: number;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
trashed: boolean;
|
||||
trashed?: boolean;
|
||||
categoryUuid: string;
|
||||
details: Details;
|
||||
overview: Overview;
|
||||
|
||||
Reference in New Issue
Block a user