bitwarden_importers/
lib.rs1#![doc = include_str!("../README.md")]
2
3use bitwarden_collections::collection::CollectionId;
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;
18mod pipeline;
19
20#[allow(missing_docs)]
29#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
30#[cfg_attr(
31 feature = "wasm",
32 derive(serde::Serialize, serde::Deserialize, tsify::Tsify),
33 tsify(from_wasm_abi)
34)]
35pub struct ImportOptions {
36 pub organization_id: Option<OrganizationId>,
37 pub target_folder: Option<ImportTargetFolder>,
38 pub target_collection: Option<ImportTargetCollection>,
39 #[cfg_attr(feature = "wasm", tsify(type = "CipherType[]"))]
42 pub restricted_types: Vec<VaultCipherType>,
43}
44
45#[allow(missing_docs)]
47#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
48#[cfg_attr(
49 feature = "wasm",
50 derive(serde::Serialize, serde::Deserialize, tsify::Tsify),
51 tsify(from_wasm_abi)
52)]
53pub struct ImportTargetFolder {
54 pub id: FolderId,
55 pub name: String,
56}
57
58#[allow(missing_docs)]
60#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
61#[cfg_attr(
62 feature = "wasm",
63 derive(serde::Serialize, serde::Deserialize, tsify::Tsify),
64 tsify(from_wasm_abi)
65)]
66pub struct ImportTargetCollection {
67 pub id: CollectionId,
68 pub name: String,
69}
70
71#[allow(missing_docs)]
74#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
75#[cfg_attr(
76 feature = "wasm",
77 derive(serde::Serialize, serde::Deserialize, tsify::Tsify),
78 tsify(into_wasm_abi)
79)]
80pub struct ImportSummary {
81 pub ciphers: Vec<CipherTypeCount>,
82 pub folders: u32,
83 pub collections: u32,
84}
85
86#[allow(missing_docs)]
88#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
89#[cfg_attr(
90 feature = "wasm",
91 derive(serde::Serialize, serde::Deserialize, tsify::Tsify),
92 tsify(into_wasm_abi)
93)]
94pub struct CipherTypeCount {
95 #[cfg_attr(feature = "wasm", tsify(type = "CipherType"))]
96 pub r#type: VaultCipherType,
97 pub count: u32,
98}