Releases: bgmulinari/B1SLayer
2.1.0
Distributed cache support
- Added support for distributed cache for session management
- For session management, B1SLayer will now use an in-memory cache implementation by default. Optionally, you can specify other implementations of
IDistributedCache
of your choosing, like in the example below:
- For session management, B1SLayer will now use an in-memory cache implementation by default. Optionally, you can specify other implementations of
using Microsoft.Extensions.Caching.Redis;
// Configures B1SLayer to use Redis as its distributed cache storage.
// This should be done on application startup before creating any SLConnection instances.
var redisCache = new RedisCache(new RedisCacheOptions
{
Configuration = "myRedisServer:6379"
});
B1SLayerSettings.DistributedCache = redisCache;
Breaking changes
- The method
LoginAsync
fromSLConnection
no longer has the optional parameterforceLogin
. Instead, a login request will always be performed when this method is called, regardless of the current session state.
Non-breaking changes
- Fixed an issue with the Ping request (#82)
- Added dependency on
Microsoft.Extensions.Caching.Abstractions
- Added dependency on
Microsoft.Extensions.Caching.Memory
- Added a direct reference to
System.Text.Json
version 6.0.11 to circumvent an existing vulnerability in version 6.0.4 (referenced by Flurl.Http)
Get it on NuGet: https://www.nuget.org/packages/B1SLayer/2.1.0
Full Changelog: 2.0.0...2.1.0
B1SLayer 2.0.0
This is the first major release of B1SLayer, which brings some breaking changes. Although the usability remains mostly unchanged, a lot of B1SLayer has changed under the hood, mainly due to the update to Flurl 4.0, which brought significant changes.
Breaking changes
- Updated Flurl.Http to version 4.0.2, which removed the dependency on
Newtonsoft.Json
in favor ofSystem.Text.Json
- Removed all
dynamic
-returning request methods (not supported inSystem.Text.Json
) - Method
WithJsonSerializerSettings
renamed toWithJsonSerializerOptions
inSLRequestExtensions
- Parameter type changed from
Newtonsoft.Json.JsonSerializerSettings
toSystem.Text.Json.JsonSerializerOptions
- Parameter type changed from
- Property
JsonSerializerSettings
renamed toJsonSerializerOptions
inSLBatchRequest
- Type changed from
Newtonsoft.Json.JsonSerializerSettings
toSystem.Text.Json.JsonSerializerOptions
- Type changed from
Non-breaking changes
- Moved from a clientless usage of Flurl to a explicit
FlurlClient
instance. This should avoid conflicts when managing multiple instances ofSLConnection
- The
FlurlClient
is accessible through the public propertyClient
in theSLConnection
instance
- The
- The HTTP error codes to be considered for a request reattempt are now accessible through the public property
HttpStatusCodesToRetry
in theSLConnection
instance - Removed dependency on
Microsoft.AspNet.WebApi.Client
in favor of own implementation to handle multipart requests - Fixed a small issue with the exception throwing logic (#70)
- Added some unit tests
- Added symbol package (.snupkg)
- Added Source Link support
- Added documentation comments that were absent to several publicly visible members
Get it on NuGet: https://www.nuget.org/packages/B1SLayer/2.0.0
B1SLayer 1.3.2
- Fixed an issue with the session management logic (#46)
Get it on NuGet: https://www.nuget.org/packages/B1SLayer/1.3.2
B1SLayer 1.3.1
- Added new request method
GetWithInlineCountAsync
(#33) - Added a 1 minute grace period for the session check to avoid requests with an invalid session (#31)
- Documentation improvements (#43)
Get it on NuGet: https://www.nuget.org/packages/B1SLayer/1.3.1
B1SLayer 1.3.0
- Added support for Single Sign-On (SSO) authentication, allowing the integration with UI API for SAP Business One add-ons (#14)
- Added the ability to add HTTP headers to
SLBatchRequest
instances through its extension methods - Added the ability to set the timeout value for batch requests through the new
BatchRequestTimeout
property in theSLConnection
class - The
Data
property from theSLBatchRequest
class now also accepts JSON strings as the request body (#13) - Added new
PostReceiveStringAsync
request method (#28) - Updated Flurl.Http to version 3.2.4
- Updated Microsoft.AspNet.WebApi.Client to version 5.2.9
Get it on NuGet: https://www.nuget.org/packages/B1SLayer/1.3.0
B1SLayer 1.2.1
- Added a new property
HttpVersion
to theSLBatchRequest
class, allowing you to specify the HTTP message version to be used. Version 1.1 will now always be used by default.
Get it on NuGet: https://www.nuget.org/packages/B1SLayer/1.2.1
B1SLayer 1.2.0
- Updated Flurl.Http to version 3.2.2
- Added new method
GetAllAsync
, allowing to obtain all entities in a collection without having to loop requests yourself - Added new
PostBatchAsync
method overload, allowing to send a variable number of batch requests without needing to put them in a list - Fixed an issue related to the "Content-ID" with batch requests when using OData v4 (b1s/v2), as reported in issue #8
- Fixed an issue related to the error response deserialization when using OData v4
- Fixed an issue where the multipart reading of the response of a batch request would fail when using OData v4
Get it on NuGet: https://www.nuget.org/packages/B1SLayer/1.2.0
B1SLayer 1.1.0
- Added new methods
BeforeCall
,AfterCall
andOnError
to theSLConnection
class, allowing for request monitoring and logging - Added new request methods
PostStringAsync
,PatchStringAsync
andPutStringAsync
- Updated Flurl.Http to version 3.2.0
- Some other minor improvements
Get it on NuGet: https://www.nuget.org/packages/B1SLayer/1.1.0
B1SLayer 1.0.3
- Added the new request method
PatchWithFileAsync
, allowing the upload of Item Images - Added additional overloads for POST request methods, in order to cover every scenario available in Service Layer
- Renamed the methods
Login
andLogout
toLoginAsync
andLogoutAsync
respectively - Some other minor improvements
B1SLayer 1.0.2
- Improved session management in multi-threaded scenarios
- Removed the
loginNow
parameter from theSLConnection
constructors as the current implementation was not ideal and could cause a deadlock - Alternativaly, the
Login
method was made public in case it's really needed to be called manually in some specific scenario - Fixed an issue with the exception handling in cases of a timeout
- Added a new request method:
GetAnonymousTypeAsync
- Added a
PostAsync
overload without a parameter for cases when a POST request is made without a JSON body, e.g. when closing an order - Added the optional parameter
unwrapCollection
(default true) to the methodGetAsync<T>
in case the default behavior is not intended - Added some XML comments that were missing