amocrm 0.5.4 → 0.6.1

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: 83afca7fb94dfd18c711481dc036012cde436a3afc8d85f45b64e29700889bb0
4
- data.tar.gz: bca4f82f6a2ba7117579147264774aefa157d12315a0ce0bc57c2d9ebf027ecf
3
+ metadata.gz: ab60c6cc7e180e60a6a693b625d24edd355d927c7bf959d220ecfbfa56c6ac30
4
+ data.tar.gz: 306e0435e62a0c30d0f84a9b0f32f2d9265eb9925edd37d567cbf32a90e5d45a
5
5
  SHA512:
6
- metadata.gz: 43337c214560438991131f4190d8e25f244bc1d81f1c8a9b5fc7e60c16c375e2d35789db44feedc20fd7fd6081b73720fe1f3a20846aca595239f30ee3c3eeb1
7
- data.tar.gz: d8e6278c6edc8093bca08afc7b3748c7807a8a1bc4214a9b35e7ac81bc49e5131184b31633c280df49f3f356d1c3dc62623176dca74657c00d6887d130af7484
6
+ metadata.gz: c286c539958ee5c9ec4eeee1aee933a783a0a7fa6b1a62f1d15a30d92a627f625ef2c25b125f22abe6dca68f3e4ae73d582a93aba59e4f298cc1e046393bd455
7
+ data.tar.gz: 4aab1d7dba0ee76dbca0ca60be8abfef20240c9e300ec19d2afeeb5fbdf7bdef123d3a006a400d1f36963141b62bf1b60c7f87847678ffb18ae561f82ac34adb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.1 (2026-06-17)
4
+
5
+ Full Changelog: [v0.6.0...v0.6.1](https://github.com/Hexlet/amocrm-ruby/compare/v0.6.0...v0.6.1)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **client:** elide content type header on requests without body ([c5d17f3](https://github.com/Hexlet/amocrm-ruby/commit/c5d17f30eca70a68ca3df7dd38bd38137d59ec0a))
10
+ * **client:** send content-type header for requests with an omitted optional body ([496a14f](https://github.com/Hexlet/amocrm-ruby/commit/496a14f1acec3e6d3f150ec83ebab8141acf670a))
11
+
12
+ ## 0.6.0 (2026-04-30)
13
+
14
+ Full Changelog: [v0.5.4...v0.6.0](https://github.com/Hexlet/amocrm-ruby/compare/v0.5.4...v0.6.0)
15
+
16
+ ### Features
17
+
18
+ * support setting headers via env ([9d3e5cc](https://github.com/Hexlet/amocrm-ruby/commit/9d3e5ccbfb69032008b65d94ea95429ad28e67ae))
19
+
20
+
21
+ ### Chores
22
+
23
+ * **internal:** more robust bootstrap script ([8159023](https://github.com/Hexlet/amocrm-ruby/commit/8159023a5aae2e0345da38e58737a8e8c3ab5c9e))
24
+
3
25
  ## 0.5.4 (2026-04-09)
4
26
 
5
27
  Full Changelog: [v0.5.3...v0.5.4](https://github.com/Hexlet/amocrm-ruby/compare/v0.5.3...v0.5.4)
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "amocrm", "~> 0.5.4"
18
+ gem "amocrm", "~> 0.6.1"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
data/lib/amocrm/client.rb CHANGED
@@ -172,6 +172,19 @@ module Amocrm
172
172
  raise ArgumentError.new("subdomain is required, and can be set via environ: \"AMOCRM_SUBDOMAIN\"")
173
173
  end
174
174
 
175
+ headers = {}
176
+ custom_headers_env = ENV["AMOCRM_CUSTOM_HEADERS"]
177
+ unless custom_headers_env.nil?
178
+ parsed = {}
179
+ custom_headers_env.split("\n").each do |line|
180
+ colon = line.index(":")
181
+ unless colon.nil?
182
+ parsed[line[0...colon].strip] = line[(colon + 1)..].strip
183
+ end
184
+ end
185
+ headers = parsed.merge(headers)
186
+ end
187
+
175
188
  @token = token.to_s
176
189
  @subdomain = subdomain.to_s
177
190
 
@@ -180,7 +193,8 @@ module Amocrm
180
193
  timeout: timeout,
181
194
  max_retries: max_retries,
182
195
  initial_retry_delay: initial_retry_delay,
183
- max_retry_delay: max_retry_delay
196
+ max_retry_delay: max_retry_delay,
197
+ headers: headers
184
198
  )
185
199
 
186
200
  @account = Amocrm::Resources::Account.new(client: self)
@@ -306,6 +306,11 @@ module Amocrm
306
306
  Amocrm::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact)
307
307
  end
308
308
 
309
+ # Generated methods always pass `req[:body]` for operations that define a
310
+ # request body, so only elide the content-type header when the operation
311
+ # has no body at all, not when an optional body param was omitted.
312
+ headers.delete("content-type") if body.nil? && !req.key?(:body)
313
+
309
314
  url = Amocrm::Internal::Util.join_parsed_uri(
310
315
  @base_url_components,
311
316
  {**req, path: path, query: query}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Amocrm
4
- VERSION = "0.5.4"
4
+ VERSION = "0.6.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amocrm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amocrm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-22 00:00:00.000000000 Z
11
+ date: 2026-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi