All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
impl Clone for OneDrive
.- Configurable
Tenant
forAuth
, this allows login into applications that accept only personal accounts. - Expose
Auth::client
. Retry-After
response header on rate limited or service unavailability is now parsed and returned viaError::retry_after
.DriveItem::download_url
(@microsoft.graph.downloadUrl
) can now be selected in$select=
.
Debug
impls ofOneDrive
andTokenResponse
now hide tokens.- Update to reqwest 0.12.
Error::source
now correctly returns its innerreqwest::Error
.Auth::code_auth_url
now returns aurl::Url
instead of aString
.Auth::login_with_{code,refresh_token}
now acceptsClientCredential
which supports no credential, client secret and certificate assertion.
- Local assertions for session upload length limit, small upload length limit. They are only enforced by the server.
- Add
create_drive_item
fordriveItem
creation with custom attributes. #6
- Bump to edition 2021 and set MSRV as 1.64.
- Many functions are marked with
#[must_use]
.
Cargo.lock
is unignored and checked in Git.- Rewrite CI and replace archived dependencies.
- Update dependencies and relax version specifications to only major digit.
- Accept
impl Into<String>
in parameters ofOneDrive::*
, which previously only acceptString
. resource::*Field::raw_name
takesself
instead of&self
, since they are nowCopy
.
- Update dependencies.
- Derive more std traits for resource and option types, including
Clone
,Copy
,PartialEq
andEq
. - More
#[must_use]
are added to warn incorrect usages. - Documentation fixes.
- Support initial state of upload sessions (
OneDrive::new_upload_session_with_initial_option
)
-
Split metadata out from
UploadSession
and make it works withoutOneDrive
instance since it doesn't require token.- New struct
UploadSessionMeta
file_size
is separated fromUploadSession
now and is required in eachUploadSession::upload_part
call.OneDrive::get_upload_session
is moved toUploadSession::get_meta
.
- New struct
- Add method
OneDrive::client
to get theClient
used to constuct the instance. - Expose constants
OneDrive::UPLOAD_SMALL_MAX_SIZE
andUploadSession::MAX_PART_SIZE
.
- Fix deserialization error of
OneDrive::upload_small
when uploading empty data.
-
Limit tracking API to root folders only since they are undocumented and doesn't work in some cases.
These API are affected:
track_changes_from_{initial,delta_url}{,_with_option}
->track_root_changes*
get_latest_delta_url{,_with_option}
->get_root_latest_delta_url*
The new API works only for root folders, and the previous
folder
parameter is removed.
- Update dependencies to
tokio
1.0 ecosystem.
- Revert
track_changes_from_delta_url_with_option
since it will cause duplicated query parameters. Instead, we introducedget_latest_delta_url_with_option
for setting options at beginning.
- Add missing
track_changes_from_delta_url_with_option
for customizingtrack_changes_from_delta_url
. - Add method
raw_name
for field descriptor enums to get raw camelCased name used in underlying requests. - Add getter
client_id/permission/redirect_uri
forAuth
.
- Bump dependencies.
- Use new rustc features to simplify codes.
- Default features of
reqwest
can be disabled bydefault-features = false
to allow switching to non-default tls implementation. - Enable gzip by default.
- New API:
get_item_download_url[_with_option]
- New variant of
ItemLocation
: locating an child by name under anItemId
.
options::*
are nowSend + Sync
- Sweet
reqwest
again. Dropapi::*
indroduced in0.5.*
. - Everything is
async
now. - Beta APIs are now under feature gate
beta
. onedrive_api::auth
async
!Authentication
->Auth
, and remove methods of token auth flow.Token
->TokenResponse
, and include all fields in Microsoft Reference.token
->access_token
to follow the reference.
onedrive_api::error
- Switch to
thiserror
. ErrorObject
->ErrorResponse
, and fix types.- Now also handle OAuth2 error response.
- Switch to
- String wrappers
onedrive_api::{DriveId, ItemId, Tag}
- Now have fields public.
onedrive_api::OneDrive
async
!UploadSession
now storesfile_size
. Methodsupload_to_session
anddelete_upload_session
are moved toUploadSession
.*Fetcher
are now pure data struct without references toOneDrive
. This makes it easy to store them withOneDrive
without worries about self-references.- Other tiny fix-ups and renames.
async
!- Refactor tests and switch to GitHub Actions as CI.
- Shrink dependencies.
- Add new api
OneDrive::update_item[_with_option]
- Derive
Serialize
andDefault
for resource objects inonedrive_api::resource
- Tests
- Tests
- Refactor all APIs with new
Api
andClient
interfaces and strip dependency toreqwest
. See docs for more details. Error::{should_retry,url}
are removed.- Rename
AuthClient
toAuthentication
, andDriveClient
toOneDrive
. - Rename
UploadSession::{get_url,get_next_expected_ranges,get_expiration_date_time}
to{upload_url,next_expected_ranges,expiration_date_time}
. - Rename
ListChildrenFetcher::get_next_url
tonext_url
- Rename
TrackChangeFetcher::{get_next_url,get_delta_url
to{next_url,delta_url}
- Rename
ListChildrenFetcher
andTrackChangeFetcher
are no longerIterator
. See docs for more details.
- Refactor and add more tests.
- Support custom HTTP backend.
- Request changes of beta api
CopyProgressMonitor::fetch_progress
- Documentations
- Renane mod
query_option
tooption
. - Move
if-match
andif-none-match
from parameter tooption
to simplify simple API (without_with_option
).
- Support
conflict_behavior
in relatedwith_option
API. - Support
expiration_date_time
field inUploadSession
. - Support tracking asynchronous
copy
operation throughCopyProgressMonitor
.
- Fix and add more documentations.
- Maintain mod structure.
- Add all fields available of
resource::{Drive, DriveItem}
in Microsoft Graph Documentation (See documentations of them).
- Refact
query_option::{Object, Collection}Option
and change parameter types of relativeDriveClient::*_with_option
methods. - Remove
resource::{Deleted, ItemReference}
, which are not necessary for using this crate. If you need more detail from these fields, just manually destruct theserde_json::Value
fields ofresource::{Drive, DriveItem}
.
- Fix documentations and add examples.
Initial release.