amocrm 0.2.0 → 0.3.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +5 -4
- data/lib/amocrm/client.rb +9 -0
- data/lib/amocrm/internal/transport/base_client.rb +6 -0
- data/lib/amocrm/version.rb +1 -1
- data/rbi/amocrm/client.rbi +5 -0
- data/rbi/amocrm/internal/transport/base_client.rbi +5 -0
- data/sig/amocrm/client.rbs +2 -0
- data/sig/amocrm/internal/transport/base_client.rbs +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 953688e737dbd47ad20302d617670f8e6e719896ebc97174d0d1e90388008fcd
|
|
4
|
+
data.tar.gz: 858c425ffcc05c3c2f61b75f4d0481fb0f3daa27461eb9b47ebccca47338a0d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9ade2d543faf32eef73ff10de52644776f4a01fff2ab270d2d8587dc38edc0421e5b9a48cae999b0ce340e0119272a448ef5b4298d22f873311162265a49476e
|
|
7
|
+
data.tar.gz: 751aed99a3da0659b98129161b649d5a76ec158a766b0a2e9eaed33a0242f6a72707c530683201c2d90b38382fcbe0aa5447033a177502db97ae3ce6ac9ad0b5
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0 (2026-02-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.2.0...v0.3.0](https://github.com/Hexlet/amocrm-ruby/compare/v0.2.0...v0.3.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([63b728e](https://github.com/Hexlet/amocrm-ruby/commit/63b728e195a95b6116d954797cd4224626c3fd28))
|
|
10
|
+
|
|
3
11
|
## 0.2.0 (2026-02-06)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.1.2...v0.2.0](https://github.com/Hexlet/amocrm-ruby/compare/v0.1.2...v0.2.0)
|
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.
|
|
18
|
+
gem "amocrm", "~> 0.3.0"
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
<!-- x-release-please-end -->
|
|
@@ -26,7 +26,10 @@ gem "amocrm", "~> 0.2.0"
|
|
|
26
26
|
require "bundler/setup"
|
|
27
27
|
require "amocrm"
|
|
28
28
|
|
|
29
|
-
amocrm = Amocrm::Client.new(
|
|
29
|
+
amocrm = Amocrm::Client.new(
|
|
30
|
+
token: ENV["AMOCRM_AUTH_TOKEN"], # This is the default and can be omitted
|
|
31
|
+
subdomain: "My-Subdomain"
|
|
32
|
+
)
|
|
30
33
|
|
|
31
34
|
response = amocrm.v4.leads.unsorted.create_forms(
|
|
32
35
|
body: [{metadata: {}, source_name: "source_name", source_uid: "source_uid"}]
|
|
@@ -83,7 +86,6 @@ You can use the `max_retries` option to configure or disable this:
|
|
|
83
86
|
# Configure the default for all requests:
|
|
84
87
|
amocrm = Amocrm::Client.new(
|
|
85
88
|
max_retries: 0, # default is 2
|
|
86
|
-
token: "My Token",
|
|
87
89
|
subdomain: "My-Subdomain"
|
|
88
90
|
)
|
|
89
91
|
|
|
@@ -102,7 +104,6 @@ By default, requests will time out after 60 seconds. You can use the timeout opt
|
|
|
102
104
|
# Configure the default for all requests:
|
|
103
105
|
amocrm = Amocrm::Client.new(
|
|
104
106
|
timeout: nil, # default is 60
|
|
105
|
-
token: "My Token",
|
|
106
107
|
subdomain: "My-Subdomain"
|
|
107
108
|
)
|
|
108
109
|
|
data/lib/amocrm/client.rb
CHANGED
|
@@ -24,6 +24,15 @@ module Amocrm
|
|
|
24
24
|
# @return [Amocrm::Resources::V4]
|
|
25
25
|
attr_reader :v4
|
|
26
26
|
|
|
27
|
+
# @api private
|
|
28
|
+
#
|
|
29
|
+
# @return [Hash{String=>String}]
|
|
30
|
+
private def auth_headers
|
|
31
|
+
return {} if @token.nil?
|
|
32
|
+
|
|
33
|
+
{"authorization" => "Bearer #{@token}"}
|
|
34
|
+
end
|
|
35
|
+
|
|
27
36
|
# Creates and returns a new client for interacting with the API.
|
|
28
37
|
#
|
|
29
38
|
# @param token [String, nil] Defaults to `ENV["AMOCRM_AUTH_TOKEN"]`
|
|
@@ -215,6 +215,11 @@ module Amocrm
|
|
|
215
215
|
@max_retry_delay = max_retry_delay
|
|
216
216
|
end
|
|
217
217
|
|
|
218
|
+
# @api private
|
|
219
|
+
#
|
|
220
|
+
# @return [Hash{String=>String}]
|
|
221
|
+
private def auth_headers = {}
|
|
222
|
+
|
|
218
223
|
# @api private
|
|
219
224
|
#
|
|
220
225
|
# @return [String]
|
|
@@ -271,6 +276,7 @@ module Amocrm
|
|
|
271
276
|
|
|
272
277
|
headers = Amocrm::Internal::Util.normalized_headers(
|
|
273
278
|
@headers,
|
|
279
|
+
auth_headers,
|
|
274
280
|
req[:headers].to_h,
|
|
275
281
|
opts[:extra_headers].to_h
|
|
276
282
|
)
|
data/lib/amocrm/version.rb
CHANGED
data/rbi/amocrm/client.rbi
CHANGED
|
@@ -19,6 +19,11 @@ module Amocrm
|
|
|
19
19
|
sig { returns(Amocrm::Resources::V4) }
|
|
20
20
|
attr_reader :v4
|
|
21
21
|
|
|
22
|
+
# @api private
|
|
23
|
+
sig { override.returns(T::Hash[String, String]) }
|
|
24
|
+
private def auth_headers
|
|
25
|
+
end
|
|
26
|
+
|
|
22
27
|
# Creates and returns a new client for interacting with the API.
|
|
23
28
|
sig do
|
|
24
29
|
params(
|
data/sig/amocrm/client.rbs
CHANGED