Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sends API in bitwarden-uniffi #217

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
target
languages
languages/*
!/languages/kotlin
languages/kotlin/*
Comment on lines +3 to +4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit awkward but that seems to be how the ignore file works yeah:
prettier/prettier#3328 (comment)

We could always remove it and add an extra step on the Readme to format the doc file after it's generated.

!/languages/kotlin/doc.md
schemas
/crates/bitwarden-napi/src-ts/bitwarden_client/schemas.ts
about.hbs
Expand Down
5 changes: 4 additions & 1 deletion crates/bitwarden-uniffi/src/docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bitwarden::{
client::auth_settings::Kdf,
mobile::crypto::InitCryptoRequest,
tool::{ExportFormat, PassphraseGeneratorRequest, PasswordGeneratorRequest},
vault::{Cipher, CipherView, Collection, Folder, FolderView},
vault::{Cipher, CipherView, Collection, Folder, FolderView, Send, SendListView, SendView},
};
use schemars::JsonSchema;

Expand All @@ -16,6 +16,9 @@ pub enum DocRef {
Collection(Collection),
Folder(Folder),
FolderView(FolderView),
Send(Send),
SendView(SendView),
SendListView(SendListView),

// Crypto
InitCryptoRequest(InitCryptoRequest),
Expand Down
97 changes: 96 additions & 1 deletion languages/kotlin/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,91 @@ Decrypt password history

**Output**: std::result::Result<Vec,BitwardenError>

## ClientSends

### `encrypt`

Encrypt send

**Arguments**:

- self:
- send: SendView

**Output**: std::result::Result<Send,BitwardenError>

### `encrypt_buffer`

Encrypt a send file in memory

**Arguments**:

- self:
- send: Send
- buffer: Vec<>

**Output**: std::result::Result<Vec,BitwardenError>

### `encrypt_file`

Encrypt a send file located in the file system

**Arguments**:

- self:
- send: Send
- decrypted_file_path: String
- encrypted_file_path: String

**Output**: std::result::Result<,BitwardenError>

### `decrypt`

Decrypt send

**Arguments**:

- self:
- send: Send

**Output**: std::result::Result<SendView,BitwardenError>

### `decrypt_list`

Decrypt send list

**Arguments**:

- self:
- sends: Vec<Send>

**Output**: std::result::Result<Vec,BitwardenError>

### `decrypt_buffer`

Decrypt a send file in memory

**Arguments**:

- self:
- send: Send
- buffer: Vec<>

**Output**: std::result::Result<Vec,BitwardenError>

### `decrypt_file`

Decrypt a send file located in the file system

**Arguments**:

- self:
- send: Send
- encrypted_file_path: String
- decrypted_file_path: String

**Output**: std::result::Result<,BitwardenError>

## ClientVault

### `folders`
Expand Down Expand Up @@ -325,14 +410,24 @@ Ciphers operations

### `password_history`

Ciphers operations
Password history operations

**Arguments**:

- self: Arc<Self>

**Output**: Arc<password_history::ClientPasswordHistory>

### `sends`

Sends operations

**Arguments**:

- self: Arc<Self>

**Output**: Arc<sends::ClientSends>

# References

References are generated from the JSON schemas and should mostly match the kotlin and swift
Expand Down
1 change: 1 addition & 0 deletions support/docs/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const rootElements = [
"ClientFolders",
"ClientGenerators",
"ClientPasswordHistory",
"ClientSends",
"ClientVault",
];

Expand Down