flex_commerce_api 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d86e4e9f3b5426f6f48162d765f57a3ee84f6d4edce274be7aac13650a39cfb4
|
|
4
|
+
data.tar.gz: 903c6d2b76ca6d8a5504b7de2da4268e405367a50d84eb13c0f9fe174053ac35
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a8f5c5d91ab5763a9943c7a1a9a7f4ef523efb0048e715e914aa8da0f025dcd1bf43ce0698946369ae85835cf9919ea52e295df36582c2424d68b0410b1ede53
|
|
7
|
+
data.tar.gz: 51895fb66baab3f8d52940bc26ca915fd2e1d6100720aad1687bd6d25416dcd00fb3e4d08ae9b9d439104adaac649ebb57c982609f947058bf9be823165321a9
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "faraday-http-cache"
|
|
2
2
|
|
|
3
3
|
module FlexCommerceApi
|
|
4
4
|
module JsonApiClientExtension
|
|
@@ -10,9 +10,10 @@ module FlexCommerceApi
|
|
|
10
10
|
add_json_api_extension = options.fetch(:add_json_api_extension, true)
|
|
11
11
|
authenticate = options.fetch(:authenticate, true)
|
|
12
12
|
include_previewed = options.fetch :include_previewed, false
|
|
13
|
-
@faraday = Faraday.new(site)
|
|
13
|
+
@faraday = Faraday.new(site) { |builder|
|
|
14
14
|
builder.request :json
|
|
15
15
|
builder.use JsonApiClientExtension::SaveRequestBodyMiddleware
|
|
16
|
+
builder.use JsonApiClientExtension::ForwardedForMiddleware
|
|
16
17
|
builder.use JsonApiClientExtension::JsonFormatMiddleware if add_json_api_extension
|
|
17
18
|
builder.use JsonApiClientExtension::PreviewedRequestMiddleware if include_previewed
|
|
18
19
|
builder.use JsonApiClient::Middleware::JsonRequest
|
|
@@ -29,7 +30,7 @@ module FlexCommerceApi
|
|
|
29
30
|
builder.adapter *adapter_options
|
|
30
31
|
builder.options[:open_timeout] = options.fetch(:open_timeout)
|
|
31
32
|
builder.options[:timeout] = options.fetch(:timeout)
|
|
32
|
-
|
|
33
|
+
}
|
|
33
34
|
faraday.basic_auth(ApiBase.username, ApiBase.password) if authenticate
|
|
34
35
|
|
|
35
36
|
yield(self) if block_given?
|
|
@@ -42,6 +43,7 @@ module FlexCommerceApi
|
|
|
42
43
|
end
|
|
43
44
|
|
|
44
45
|
private
|
|
46
|
+
|
|
45
47
|
def cache_options(options)
|
|
46
48
|
{
|
|
47
49
|
# treats the cache like a client, not a proxy
|