1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 06:13:38 +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:
Daniel James Smith
2022-03-08 13:42:35 +01:00
committed by GitHub
parent 67a4fc8591
commit 744649573a
23 changed files with 7507 additions and 7608 deletions

View File

@@ -18,7 +18,6 @@ import {
ExportData, ExportData,
FieldsEntity, FieldsEntity,
Item, Item,
ItemCollection,
LoginFieldTypeEnum, LoginFieldTypeEnum,
Overview, Overview,
PasswordHistoryEntity, PasswordHistoryEntity,
@@ -38,8 +37,7 @@ export class OnePassword1PuxImporter extends BaseImporter implements Importer {
// TODO Add handling of multiple vaults // TODO Add handling of multiple vaults
// const personalVaults = account.vaults[0].filter((v) => v.attrs.type === VaultAttributeTypeEnum.Personal); // const personalVaults = account.vaults[0].filter((v) => v.attrs.type === VaultAttributeTypeEnum.Personal);
account.vaults.forEach((vault: VaultsEntity) => { account.vaults.forEach((vault: VaultsEntity) => {
vault.items.forEach((itemCollection: ItemCollection) => { vault.items.forEach((item: Item) => {
const item: Item = itemCollection.item;
if (item.trashed === true) { if (item.trashed === true) {
return; return;
} }

View File

@@ -15,7 +15,7 @@ export interface AccountAttributes {
} }
export interface VaultsEntity { export interface VaultsEntity {
attrs: VaultAttributes; attrs: VaultAttributes;
items?: ItemCollection[] | null; items?: Item[] | null;
} }
export interface VaultAttributes { export interface VaultAttributes {
uuid: string; uuid: string;
@@ -24,9 +24,6 @@ export interface VaultAttributes {
name: string; name: string;
type: string; type: string;
} }
export interface ItemCollection {
item: Item;
}
export enum CategoryEnum { export enum CategoryEnum {
Login = "001", Login = "001",
@@ -56,7 +53,7 @@ export interface Item {
favIndex: number; favIndex: number;
createdAt: number; createdAt: number;
updatedAt: number; updatedAt: number;
trashed: boolean; trashed?: boolean;
categoryUuid: string; categoryUuid: string;
details: Details; details: Details;
overview: Overview; overview: Overview;

View File

@@ -22,7 +22,6 @@ export const APICredentialsData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "6nqnjdqyk5mwvqbdgbdr47oabe", uuid: "6nqnjdqyk5mwvqbdgbdr47oabe",
favIndex: 0, favIndex: 0,
createdAt: 1619465969, createdAt: 1619465969,
@@ -162,7 +161,6 @@ export const APICredentialsData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const BankAccountData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "u2l4sjbencvsowwjuj3dfpt73q", uuid: "u2l4sjbencvsowwjuj3dfpt73q",
favIndex: 0, favIndex: 0,
createdAt: 1619466056, createdAt: 1619466056,
@@ -217,7 +216,6 @@ export const BankAccountData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const CreditCardData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "vpxi2esuujz7nrbojp34rd5aja", uuid: "vpxi2esuujz7nrbojp34rd5aja",
favIndex: 0, favIndex: 0,
createdAt: 1619465282, createdAt: 1619465282,
@@ -336,7 +335,6 @@ export const CreditCardData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const DatabaseData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "ospvepl3ex2y6hjwwqwyvtf2sy", uuid: "ospvepl3ex2y6hjwwqwyvtf2sy",
favIndex: 0, favIndex: 0,
createdAt: 1619466193, createdAt: 1619466193,
@@ -194,7 +193,6 @@ export const DatabaseData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const DriversLicenseData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "nntuge2g7s2wrlokyfhea354ay", uuid: "nntuge2g7s2wrlokyfhea354ay",
favIndex: 0, favIndex: 0,
createdAt: 1619466279, createdAt: 1619466279,
@@ -226,7 +225,6 @@ export const DriversLicenseData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const EmailAccountData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "p3hohdgwpt4u2ra2fc3tvzomsm", uuid: "p3hohdgwpt4u2ra2fc3tvzomsm",
favIndex: 0, favIndex: 0,
createdAt: 1619466428, createdAt: 1619466428,
@@ -334,7 +333,6 @@ export const EmailAccountData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const IdentityData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "45mjttbbq3owgij2uis55pfrlq", uuid: "45mjttbbq3owgij2uis55pfrlq",
favIndex: 0, favIndex: 0,
createdAt: 1619465450, createdAt: 1619465450,
@@ -469,7 +468,6 @@ export const IdentityData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const LoginData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "2b3hr6p5hinr7prtrj65bwmxqu", uuid: "2b3hr6p5hinr7prtrj65bwmxqu",
favIndex: 0, favIndex: 0,
createdAt: 1635522833, createdAt: 1635522833,
@@ -128,7 +127,6 @@ export const LoginData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const MedicalRecordData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "42mj5boh5rxq7uqjrmkslmhosu", uuid: "42mj5boh5rxq7uqjrmkslmhosu",
favIndex: 0, favIndex: 0,
createdAt: 1641220207, createdAt: 1641220207,
@@ -191,7 +190,6 @@ export const MedicalRecordData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const MembershipData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "ofdp2szoty2ujk6yv5ebn4wjr4", uuid: "ofdp2szoty2ujk6yv5ebn4wjr4",
favIndex: 1, favIndex: 1,
createdAt: 1619467269, createdAt: 1619467269,
@@ -179,7 +178,6 @@ export const MembershipData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const OnePuxExampleFile: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "fkruyzrldvizuqlnavfj3gltfe", uuid: "fkruyzrldvizuqlnavfj3gltfe",
favIndex: 1, favIndex: 1,
createdAt: 1614298956, createdAt: 1614298956,
@@ -86,7 +85,6 @@ export const OnePuxExampleFile: ExportData = {
pgrng: true, pgrng: true,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const OutdoorLicenseData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "6fb73t5lk7vc52h3osw3ccmguy", uuid: "6fb73t5lk7vc52h3osw3ccmguy",
favIndex: 0, favIndex: 0,
createdAt: 1619467374, createdAt: 1619467374,
@@ -162,7 +161,6 @@ export const OutdoorLicenseData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const PassportData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "hffila4ew2e3krfzp2tkdkdmea", uuid: "hffila4ew2e3krfzp2tkdkdmea",
favIndex: 0, favIndex: 0,
createdAt: 1619467498, createdAt: 1619467498,
@@ -227,7 +226,6 @@ export const PassportData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const PasswordData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "qpdsrgpngzud3x3rbfvyrz3ane", uuid: "qpdsrgpngzud3x3rbfvyrz3ane",
favIndex: 0, favIndex: 0,
createdAt: 1619465796, createdAt: 1619465796,
@@ -51,7 +50,6 @@ export const PasswordData: ExportData = {
pgrng: true, pgrng: true,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const RewardsProgramData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "3bmrdcml3tngvsr6zdlvd2xo4i", uuid: "3bmrdcml3tngvsr6zdlvd2xo4i",
favIndex: 0, favIndex: 0,
createdAt: 1619467659, createdAt: 1619467659,
@@ -202,7 +201,6 @@ export const RewardsProgramData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const SSNData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "vi2biozc7sjnhr5sejk74nz26i", uuid: "vi2biozc7sjnhr5sejk74nz26i",
favIndex: 1, favIndex: 1,
createdAt: 1619467910, createdAt: 1619467910,
@@ -82,7 +81,6 @@ export const SSNData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const SanitizedExport: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "7vb6easqqfiocr6nppsza7ccvm", uuid: "7vb6easqqfiocr6nppsza7ccvm",
favIndex: 1, favIndex: 1,
createdAt: 1619465029, createdAt: 1619465029,
@@ -111,9 +110,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "35szbzswhgeq3wyblg7odmshhu", uuid: "35szbzswhgeq3wyblg7odmshhu",
favIndex: 0, favIndex: 0,
createdAt: 1619467769, createdAt: 1619467769,
@@ -313,9 +310,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "zt7ejrtqyxhnrve353yo52lzra", uuid: "zt7ejrtqyxhnrve353yo52lzra",
favIndex: 0, favIndex: 0,
createdAt: 1619465117, createdAt: 1619465117,
@@ -414,9 +409,7 @@ export const SanitizedExport: ExportData = {
pgrng: true, pgrng: true,
}, },
}, },
},
{ {
item: {
uuid: "6rveeumeacoxy6qof4wsaag5me", uuid: "6rveeumeacoxy6qof4wsaag5me",
favIndex: 0, favIndex: 0,
createdAt: 1619465875, createdAt: 1619465875,
@@ -443,9 +436,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "u2l4sjbencvsowwjuj3dfpt73q", uuid: "u2l4sjbencvsowwjuj3dfpt73q",
favIndex: 0, favIndex: 0,
createdAt: 1619466056, createdAt: 1619466056,
@@ -640,9 +631,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "ospvepl3ex2y6hjwwqwyvtf2sy", uuid: "ospvepl3ex2y6hjwwqwyvtf2sy",
favIndex: 0, favIndex: 0,
createdAt: 1619466193, createdAt: 1619466193,
@@ -814,9 +803,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "a5pke7sx3yt7wve6kwyt3ocjrq", uuid: "a5pke7sx3yt7wve6kwyt3ocjrq",
favIndex: 1, favIndex: 1,
createdAt: 1619464754, createdAt: 1619464754,
@@ -859,9 +846,7 @@ export const SanitizedExport: ExportData = {
pgrng: true, pgrng: true,
}, },
}, },
},
{ {
item: {
uuid: "nntuge2g7s2wrlokyfhea354ay", uuid: "nntuge2g7s2wrlokyfhea354ay",
favIndex: 0, favIndex: 0,
createdAt: 1619466279, createdAt: 1619466279,
@@ -1065,9 +1050,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "p3hohdgwpt4u2ra2fc3tvzomsm", uuid: "p3hohdgwpt4u2ra2fc3tvzomsm",
favIndex: 0, favIndex: 0,
createdAt: 1619466428, createdAt: 1619466428,
@@ -1379,9 +1362,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "47hvppiuwbanbza7bq6jpdjfxu", uuid: "47hvppiuwbanbza7bq6jpdjfxu",
favIndex: 1, favIndex: 1,
createdAt: 1619467985, createdAt: 1619467985,
@@ -1635,9 +1616,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "hffila4ew2e3krfzp2tkdkdmea", uuid: "hffila4ew2e3krfzp2tkdkdmea",
favIndex: 0, favIndex: 0,
createdAt: 1619467498, createdAt: 1619467498,
@@ -1842,9 +1821,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "6fb73t5lk7vc52h3osw3ccmguy", uuid: "6fb73t5lk7vc52h3osw3ccmguy",
favIndex: 0, favIndex: 0,
createdAt: 1619467374, createdAt: 1619467374,
@@ -1984,9 +1961,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "qpdsrgpngzud3x3rbfvyrz3ane", uuid: "qpdsrgpngzud3x3rbfvyrz3ane",
favIndex: 0, favIndex: 0,
createdAt: 1619465796, createdAt: 1619465796,
@@ -2015,9 +1990,7 @@ export const SanitizedExport: ExportData = {
pgrng: true, pgrng: true,
}, },
}, },
},
{ {
item: {
uuid: "3wilgt5oauovqibipjulk7vwqi", uuid: "3wilgt5oauovqibipjulk7vwqi",
favIndex: 0, favIndex: 0,
createdAt: 1619468234, createdAt: 1619468234,
@@ -2173,9 +2146,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "3bmrdcml3tngvsr6zdlvd2xo4i", uuid: "3bmrdcml3tngvsr6zdlvd2xo4i",
favIndex: 0, favIndex: 0,
createdAt: 1619467659, createdAt: 1619467659,
@@ -2355,9 +2326,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "vi2biozc7sjnhr5sejk74nz26i", uuid: "vi2biozc7sjnhr5sejk74nz26i",
favIndex: 1, favIndex: 1,
createdAt: 1619467910, createdAt: 1619467910,
@@ -2417,9 +2386,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "ofdp2szoty2ujk6yv5ebn4wjr4", uuid: "ofdp2szoty2ujk6yv5ebn4wjr4",
favIndex: 1, favIndex: 1,
createdAt: 1619467269, createdAt: 1619467269,
@@ -2576,9 +2543,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "45mjttbbq3owgij2uis55pfrlq", uuid: "45mjttbbq3owgij2uis55pfrlq",
favIndex: 0, favIndex: 0,
createdAt: 1619465450, createdAt: 1619465450,
@@ -3025,9 +2990,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "6nqnjdqyk5mwvqbdgbdr47oabe", uuid: "6nqnjdqyk5mwvqbdgbdr47oabe",
favIndex: 0, favIndex: 0,
createdAt: 1619465969, createdAt: 1619465969,
@@ -3167,9 +3130,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "gcozv72svonjgufn4q5hnyzwmu", uuid: "gcozv72svonjgufn4q5hnyzwmu",
favIndex: 0, favIndex: 0,
createdAt: 1619465226, createdAt: 1619465226,
@@ -3192,9 +3153,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "vpxi2esuujz7nrbojp34rd5aja", uuid: "vpxi2esuujz7nrbojp34rd5aja",
favIndex: 0, favIndex: 0,
createdAt: 1619465282, createdAt: 1619465282,
@@ -3508,7 +3467,6 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
{ {
@@ -3521,7 +3479,6 @@ export const SanitizedExport: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "sxsme6jieoac2zik77gcixghyu", uuid: "sxsme6jieoac2zik77gcixghyu",
favIndex: 0, favIndex: 0,
createdAt: 1623365944, createdAt: 1623365944,
@@ -3554,9 +3511,7 @@ export const SanitizedExport: ExportData = {
url: "", url: "",
}, },
}, },
},
{ {
item: {
uuid: "fnnva6qkqdc3bv3qte2npnz6l4", uuid: "fnnva6qkqdc3bv3qte2npnz6l4",
favIndex: 0, favIndex: 0,
createdAt: 1577652307, createdAt: 1577652307,
@@ -3709,9 +3664,7 @@ export const SanitizedExport: ExportData = {
url: "", url: "",
}, },
}, },
},
{ {
item: {
uuid: "rk4jn3z3kc2lr5zegpeyn3si6q", uuid: "rk4jn3z3kc2lr5zegpeyn3si6q",
favIndex: 0, favIndex: 0,
createdAt: 1595730395, createdAt: 1595730395,
@@ -3863,9 +3816,7 @@ export const SanitizedExport: ExportData = {
url: "", url: "",
}, },
}, },
},
{ {
item: {
uuid: "2b3hr6p5hinr7prtrj65bwmxqu", uuid: "2b3hr6p5hinr7prtrj65bwmxqu",
favIndex: 0, favIndex: 0,
createdAt: 1635522833, createdAt: 1635522833,
@@ -3991,9 +3942,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "doj33uc6hsstee2s5hqh275wfm", uuid: "doj33uc6hsstee2s5hqh275wfm",
favIndex: 0, favIndex: 0,
createdAt: 1607125760, createdAt: 1607125760,
@@ -4247,9 +4196,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "q6icpq5myuxzdgvmr3i6ftzv7y", uuid: "q6icpq5myuxzdgvmr3i6ftzv7y",
favIndex: 0, favIndex: 0,
createdAt: 1609647825, createdAt: 1609647825,
@@ -4271,9 +4218,7 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
{ {
item: {
uuid: "735xgvo264tz2e2aa5ntxa55li", uuid: "735xgvo264tz2e2aa5ntxa55li",
favIndex: 0, favIndex: 0,
createdAt: 1576938097, createdAt: 1576938097,
@@ -4551,7 +4496,6 @@ export const SanitizedExport: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const SecureNoteData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "gcozv72svonjgufn4q5hnyzwmu", uuid: "gcozv72svonjgufn4q5hnyzwmu",
favIndex: 0, favIndex: 0,
createdAt: 1619465226, createdAt: 1619465226,
@@ -45,7 +44,6 @@ export const SecureNoteData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const ServerData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "35szbzswhgeq3wyblg7odmshhu", uuid: "35szbzswhgeq3wyblg7odmshhu",
favIndex: 0, favIndex: 0,
createdAt: 1619467769, createdAt: 1619467769,
@@ -222,7 +221,6 @@ export const ServerData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const SoftwareLicenseData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "47hvppiuwbanbza7bq6jpdjfxu", uuid: "47hvppiuwbanbza7bq6jpdjfxu",
favIndex: 1, favIndex: 1,
createdAt: 1619467985, createdAt: 1619467985,
@@ -276,7 +275,6 @@ export const SoftwareLicenseData: ExportData = {
pgrng: false, pgrng: false,
}, },
}, },
},
], ],
}, },
], ],

View File

@@ -22,7 +22,6 @@ export const WirelessRouterData: ExportData = {
}, },
items: [ items: [
{ {
item: {
uuid: "fnnva6qkqdc3bv3qte2npnz6l4", uuid: "fnnva6qkqdc3bv3qte2npnz6l4",
favIndex: 0, favIndex: 0,
createdAt: 1577652307, createdAt: 1577652307,
@@ -175,7 +174,6 @@ export const WirelessRouterData: ExportData = {
url: "", url: "",
}, },
}, },
},
], ],
}, },
], ],