bitwarden_importers/
lib.rs1#![doc = include_str!("../README.md")]
2
3use bitwarden_collections::collection::{CollectionId, CollectionType};
4use bitwarden_core::OrganizationId;
5use bitwarden_vault::{CipherType as VaultCipherType, FolderId};
6
7#[cfg(feature = "uniffi")]
8uniffi::setup_scaffolding!();
9#[cfg(feature = "uniffi")]
10mod uniffi_support;
11
12mod error;
13pub use error::ImportError;
14mod import;
15mod importer_client;
16pub use importer_client::{ImporterClient, ImporterClientExt};
17mod importers;
18pub(crate) use importers::keeper;
19pub use importers::onepassword::access::{
20 Credentials, EnrollmentStatus as OnePasswordSsoEnrollmentStatus, SignInAddress, SignInDomain,
21 SignInMethods as OnePasswordSignInMethods, SsoCredentials as OnePasswordSsoCredentials,
22 SsoEnrollmentContext as OnePasswordSsoEnrollment,
23 SsoEnrollmentResult as OnePasswordSsoEnrollmentResult,
24 SsoLoginResult as OnePasswordSsoLoginResult, SsoUi as OnePasswordSsoUi,
25 TotpResult as OnePasswordTotpResult, TwoFactorUi as OnePasswordTwoFactorUi,
26 VerificationCodeResult as OnePasswordVerificationCodeResult,
27 model::{ItemCategory, SkippedItem, SkippedReason, SkippedVault},
28};
29mod pipeline;
30#[cfg(feature = "wasm")]
31mod wasm;
32
33#[allow(missing_docs)]
42#[derive(serde::Serialize, serde::Deserialize)]
43#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
44#[bitwarden_ffi::wasm_record]
45pub struct ImportOptions {
46 pub organization_id: Option<OrganizationId>,
47 pub target_folder: Option<ImportTargetFolder>,
48 pub target_collection: Option<ImportTargetCollection>,
49 #[cfg_attr(feature = "wasm", tsify(type = "CipherType[]"))]
52 pub restricted_types: Vec<VaultCipherType>,
53}
54
55#[allow(missing_docs)]
57#[derive(serde::Serialize, serde::Deserialize)]
58#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
59#[bitwarden_ffi::wasm_record]
60pub struct ImportTargetFolder {
61 pub id: FolderId,
62 pub name: String,
63}
64
65#[allow(missing_docs)]
69#[derive(serde::Serialize, serde::Deserialize)]
70#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
71#[bitwarden_ffi::wasm_record]
72pub struct ImportTargetCollection {
73 pub id: CollectionId,
74 pub name: String,
75 pub r#type: CollectionType,
76}
77
78#[allow(missing_docs)]
81#[derive(serde::Serialize, serde::Deserialize)]
82#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
83#[bitwarden_ffi::wasm_record]
84pub struct ImportSummary {
85 pub ciphers: Vec<CipherTypeCount>,
86 pub folders: u32,
87 pub collections: u32,
88}
89
90#[allow(missing_docs)]
92#[derive(serde::Serialize, serde::Deserialize)]
93#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
94#[bitwarden_ffi::wasm_record]
95pub struct OnePasswordImportSummary {
96 pub imported: ImportSummary,
97 pub skipped_vaults: Vec<SkippedVault>,
98 pub skipped_items: Vec<SkippedItem>,
99}
100
101#[allow(missing_docs)]
103#[derive(serde::Serialize, serde::Deserialize)]
104#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
105#[bitwarden_ffi::wasm_record]
106pub struct CipherTypeCount {
107 #[cfg_attr(feature = "wasm", tsify(type = "CipherType"))]
108 pub r#type: VaultCipherType,
109 pub count: u32,
110}