esa 3.1.0 → 3.2.0

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: 93e305f596857d93c6f6489344371fa9369488b819ab4071804cdb0e576c8c11
4
- data.tar.gz: 6d3fd439655db92eaa698a77d4a23dad260b2e8f451fe0f35a6b89877419d251
3
+ metadata.gz: b3089322959101e1af0cf6af4f0157da7a32c330a1e3932ba06e8186ba5bbf9c
4
+ data.tar.gz: 98999fb35d75f5b2e6d807db662c013b086eda587d215c20c93efe54fe577773
5
5
  SHA512:
6
- metadata.gz: 743652d2bd4dc1de8c4d0d7cec158bbeb4277cba7c523f476b2ed0371475add00e3f2f3e336cb9f43e502b40a7c7174677f0b40044af979df2bb6d58d6eca1e2
7
- data.tar.gz: f38b5e9d9e1f471f16d4009412c25d64830620f40303bbe533889a90526367e965b7b7c013de67b6c3008276982e1dafee208df6e59f28c77d4e7690ab5e038c
6
+ metadata.gz: 4b9471c0180ae168c740a3e925847e8c322e220d8b9fde86345b6aac4162a7b110ecbdcffd673dea89f28db8a3c3ea44f4fb9ff697ffdfca078608a827530c43
7
+ data.tar.gz: 4480d074b055194abc5d8ba033164ab734bd33e1afad5b2fbc400d8463f7a8aae96be774011b9495bd7dba9870d12b8231fa36386da4cbc71a5d8267da128879
data/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  nothing
4
4
 
5
+ ## 3.2.0 (2025-07-08)
6
+ - add: [Support `faraday_middlewares` option in Esa::Client](https://github.com/esaio/esa-ruby/pull/71)
7
+
5
8
  ## 3.1.0 (2025-02-21)
6
9
  - add: [Add signed_urls method](https://github.com/esaio/esa-ruby/pull/70)
7
10
 
data/README.md CHANGED
@@ -26,6 +26,9 @@ Or install it yourself as:
26
26
  # Initialization
27
27
  client = Esa::Client.new(access_token: "<access_token>", current_team: 'foo')
28
28
 
29
+ # Initialization with faraday_middlewares
30
+ # client = Esa::Client.new(access_token: "<access_token>", current_team: 'foo', faraday_middlewares: [Faraday::Response::Logger])
31
+
29
32
  # Authenticated User API
30
33
  client.user
31
34
  #=> GET /v1/user
data/lib/esa/client.rb CHANGED
@@ -8,14 +8,15 @@ module Esa
8
8
 
9
9
  include ApiMethods
10
10
 
11
- def initialize(access_token: nil, api_endpoint: nil, current_team: nil, default_headers: {}, retry_on_rate_limit_exceeded: true)
11
+ def initialize(access_token: nil, api_endpoint: nil, current_team: nil, default_headers: {}, retry_on_rate_limit_exceeded: true, faraday_middlewares: [])
12
12
  @access_token = access_token
13
13
  @api_endpoint = api_endpoint
14
14
  @current_team = current_team
15
15
  @default_headers = default_headers
16
16
  @retry_on_rate_limit_exceeded = retry_on_rate_limit_exceeded
17
+ @faraday_middlewares = faraday_middlewares
17
18
  end
18
- attr_accessor :current_team, :default_headers, :retry_on_rate_limit_exceeded
19
+ attr_accessor :current_team, :default_headers, :retry_on_rate_limit_exceeded, :faraday_middlewares
19
20
 
20
21
  def current_team!
21
22
  raise TeamNotSpecifiedError, "current_team is not specified" unless @current_team
@@ -63,6 +64,7 @@ module Esa
63
64
 
64
65
  def esa_connection
65
66
  @esa_connection ||= Faraday.new(faraday_options) do |c|
67
+ faraday_middlewares.each { |faraday_middleware| c.use faraday_middleware }
66
68
  c.request :json
67
69
  c.response :json
68
70
  c.adapter Faraday.default_adapter
@@ -71,6 +73,7 @@ module Esa
71
73
 
72
74
  def s3_connection
73
75
  @s3_connection ||= Faraday.new do |c|
76
+ faraday_middlewares.each { |faraday_middleware| c.use faraday_middleware }
74
77
  c.request :multipart
75
78
  c.request :url_encoded
76
79
  c.response :xml
@@ -80,6 +83,7 @@ module Esa
80
83
 
81
84
  def simple_connection
82
85
  @simple_connection ||= Faraday.new do |c|
86
+ faraday_middlewares.each { |faraday_middleware| c.use faraday_middleware }
83
87
  c.adapter Faraday.default_adapter
84
88
  end
85
89
  end
data/lib/esa/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Esa
4
- VERSION = '3.1.0'
4
+ VERSION = '3.2.0'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esa
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - fukayatsu
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-20 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: base64
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  - !ruby/object:Gem::Version
218
218
  version: '0'
219
219
  requirements: []
220
- rubygems_version: 3.6.2
220
+ rubygems_version: 3.6.7
221
221
  specification_version: 4
222
222
  summary: esa API v1 client library, written in Ruby
223
223
  test_files: []