diff --git a/extension/src/shared/messages.ts b/extension/src/shared/messages.ts index 1788701..f5a73a7 100644 --- a/extension/src/shared/messages.ts +++ b/extension/src/shared/messages.ts @@ -55,7 +55,9 @@ export type PopupMessage = bytes: ArrayBuffer; passphrase: string; newRemote: { hostType: 'gitea' | 'github'; hostUrl: string; repoPath: string; apiToken: string }; - }; + } + | { type: 'parse_lastpass_csv'; bytes: ArrayBuffer } + | { type: 'import_lastpass_commit'; items: Item[] }; // --- Messages a content script may send --- @@ -161,6 +163,7 @@ export const POPUP_ONLY_TYPES: ReadonlySet = new Set([ 'get_field_history', 'get_session_config', 'update_session_config', 'export_backup', 'restore_backup', + 'parse_lastpass_csv', 'import_lastpass_commit', ] as PopupMessage['type'][]); export interface ExportBackupResponse extends Extract { @@ -173,6 +176,19 @@ export interface RestoreBackupResponse extends Extract { }; } +export interface ParseLastPassCsvResponse extends Extract { + data: { + items: Item[]; + warnings: Array<{ row: number; title?: string; message: string }>; + }; +} + +export interface ImportLastPassCommitResponse extends Extract { + data: { + summary: { itemCount: number }; + }; +} + export const CONTENT_CALLABLE_TYPES: ReadonlySet = new Set([ 'get_autofill_candidates', 'get_credentials', 'check_credential', 'blacklist_site', 'capture_save_login',