ShopifySharp Versions Save

ShopifySharp is a .NET library that helps developers easily authenticate with and manage Shopify stores.

ShopifySharp.Extensions.DependencyInjection/1.5.0

1 month ago

Summary

This is a new release for ShopifySharp.Extensions.DependencyInjection, bumping the version up to 1.5.0. You can now set the service lifetime when registering ShopifySharp with Microsoft's DI container:

ServiceLifetime serviceLifetime = ServiceLifetime.Scoped;

services.AddShopifySharp<MyRequestExecutionPolicy>(serviceLifetime);

Previously, all services were registered as a singleton and you had no control over the lifetime.

You can download the latest version of ShopifySharp.Extensions.DependencyInjection from Nuget using your IDE, or via the dotnet CLI with dotnet package install shopifysharp.extensions.dependencyinjection.

What's Changed

New Contributors

Full Changelog: https://github.com/nozzlegear/ShopifySharp/compare/ShopifySharp.Extensions.DependencyInjection/1.4.0...ShopifySharp.Extensions.DependencyInjection/1.5.0

How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd rather contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad.

ShopifySharp/6.14.0

1 month ago

Summary

This release bumps ShopifySharp's version up to 6.14.0, containing several bugfixes, new entities, and new fields for existing entities. You can download the latest version of ShopifySharp from Nuget using your IDE, or via the dotnet CLI with dotnet package install shopifysharp.

New features and services

Bug fixes

Miscelleneous changes

New Contributors

Full Changelog: https://github.com/nozzlegear/ShopifySharp/compare/ShopifySharp/6.13.0...ShopifySharp/6.14.0

How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd rather contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad.

ShopifySharp.Extensions.DependencyInjection/1.4.0

3 months ago

What's Changed

Dynamic factory service registration via IServiceFactory<T>

A pull request by @adearriba refactored ShopifySharp's service factory classes so that they all use a common IServiceFactory<T> interface to implement their factory methods. This is then used to dynamically register all service factories in ShopifySharp when you use services.AddShopifySharp() or services.AddShopifySharpServiceFactories().

Pull requests

Full Changelog: https://github.com/nozzlegear/ShopifySharp/compare/ShopifySharp.Extensions.DependencyInjection/1.3.0...ShopifySharp.Extensions.DependencyInjection/1.4.0

ShopifySharp/6.13.0

3 months ago

What's Changed

Shopify API Version 2024-01

This release now targets version 2024-01 of Shopify's API! Previously, ShopifySharp was targeting version 2023-07. We've regenerated the GraphQL classes accordingly, so be prepared for breaking changes if you use any of the Graph objects that Shopify has changed in their latest API.

Deprecations

The deprecated CustomerSavedSearchService has been removed in this release. Shopify recommends that you use the GraphQL Customer Segment API instead.

Pull requests

Full Changelog: https://github.com/nozzlegear/ShopifySharp/compare/ShopifySharp/6.12.2...ShopifySharp/6.13.0

ShopifySharp/6.12.2

3 months ago

What's Changed

Bug fixes

This release fixes a bug with the ShopifyOauthUtility.RefreshAccessTokenAsync method, which was disposing the static HttpClient in ShopifySharp's InternalHttpClientFactory. If the developer did not supply their own IHttpClientFactory to the ShopifyService via ShopifyService.SetHttpClientFactory, then any service that attempted to call the Shopify API after the disposal would throw an ObjectDisposedException for the lifetime of the application.

Note: because the deprecated AuthorizationService.RefreshAccessTokenAsync calls the ShopifyOauthUtility behind the scenes, it was also affected by this bug.

More info about this bug can be found in #1005.

Pull requests

Full Changelog: https://github.com/nozzlegear/ShopifySharp/compare/ShopifySharp/6.12.1...ShopifySharp/6.12.2

ShopifySharp/6.12.1

3 months ago

What's Changed

Bug fixes

Reported in #1001 and fixed in #1002 where the CloneableRequestMessage underlying all request execution policies would fail to clone the request's content if the request wasn't sending JsonContent. In practice, this only affected the PartnerService, GraphService, and any service that derived from them, and only if the requests were cloned on a retry in the execution policy.

Also reported in #1001 and fixed in #1002 was a bug affecting the LeakyBucketExecutionPolicy and RetryExecutionPolicy, where the original request were accidentally disposed before the policies could retry them if they had received an unsuccessful response. This would result in the policies throwing an ObjectDisposedException.

Repository changes

ShopifySharp's documentation has a new home thanks to @Laurabee530! Where before all of the documentation for the package was crammed into the main readme – which made for a very long scroll – you can now find the documentation for each individual service in ShopifySharp's wiki here on Github.

Pull requests

New Contributors

Full Changelog: https://github.com/nozzlegear/ShopifySharp/compare/ShopifySharp/6.12.0...ShopifySharp/6.12.1

ShopifySharp/6.12.0

3 months ago

What's Changed

Bug fixes

A bug was fixed in #997 that could cause the ShopifyDomainUtility.IsValidShopDomainAsync method to erroneously return true in cases where the response contained an X-ShopId header with an empty value. (#995)

ShopifyException refactoring

The following changes were made to the exception classes in ShopifySharp:

  • Introduced a new exception type named ShopifyHttpException, which inherits from the base ShopifyException. This new exception should be thrown whenever an http request fails or returns an error.
  • Made the ShopifyRateLimitException inherit from the ShopifyHttpException.
  • Deprecated most HTTP properties on the base ShopifyException:
    • HttpStatusCode
    • RequestId
    • Errors
    • RawBody
  • Removed the deprecated ShopifyException.HttpResponse property.
  • Refactored the base ShopifyService, GraphService and PartnerService classes to throw a ShopifyHttpException where applicable.
  • Removed a custom error message that was injected into the ShopifyException.Errors string list in some cases. This error message was an exact duplicate of the exception's message.

Leaky Bucket Execution Policy and Retry Execution Policy enhancements

Added small enhancements to the Leaky Bucket execution policy and the Retry execution policy to make them retry certain common request http request failures. I've based this code off of the retry policy found in Microsoft's Azure.Core SDK (MIT licensed), though it's not quite a one-to-one match since we don't have the concept of an HTTP pipeline in ShopifySharp.

These are the status codes that will be retried if a request fails in the Leaky Bucket and Retry execution policies:

case 408: // Request Timeout
case 429: // Too Many Requests
case 500: // Internal Server Error
case 502: // Bad Gateway
case 503: // Service Unavailable
case 504: // Gateway Timeout

The policies will retry these requests up to three times before throwing a ShopifyHttpException.

Importantly, the default behavior of the Leaky Bucket and Retry policies should remain intact -- they won't start retrying additional responses unless you opt-in to the behavior by using the new constructor overloads on each policy. I wanted to make this change available for testing and feedback right now, so I can gather some feedback on it.

Pull requests

Full Changelog: https://github.com/nozzlegear/ShopifySharp/compare/ShopifySharp/6.11.0...ShopifySharp/6.12.0

ShopifySharp.Extensions.DependencyInjection/1.1.1

4 months ago

ShopifySharp/6.8.3

4 months ago

ShopifySharp.Extensions.DependencyInjection/1.1.0

4 months ago