From 9a3e7375b6cca91433c8732e6fa060ecea85519c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 09:38:12 +0000 Subject: [PATCH 1/9] chore(internal): tweak CI branches --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d97c5d8..8ec89fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' From 9fb96c78308d30c29ead727cc05a101cdd1b97d1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 04:06:36 +0000 Subject: [PATCH 2/9] chore(internal): update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3d26cee..fc9eb28 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .idea/ .ignore .prism.log +.stdy.log .ruby-lsp/ .yardoc/ bin/tapioca From dad96e5408642a9781334f2bb4dbc32cd73872d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 03:00:23 +0000 Subject: [PATCH 3/9] chore(ci): skip lint on metadata-only changes Note that we still want to run tests, as these depend on the metadata. --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ec89fc..258f17f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,8 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/amocrm-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: |- github.repository == 'stainless-sdks/amocrm-ruby' && - (github.event_name == 'push' || github.event.pull_request.head.repo.fork) + (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && + (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 - name: Set up Ruby From 4975893b8eb2d4f427e7d40c07a3b7c1413168fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 05:21:11 +0000 Subject: [PATCH 4/9] fix(internal): correct multipart form field name encoding --- lib/amocrm/internal/util.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/amocrm/internal/util.rb b/lib/amocrm/internal/util.rb index 0d9e3b6..b90add1 100644 --- a/lib/amocrm/internal/util.rb +++ b/lib/amocrm/internal/util.rb @@ -573,8 +573,7 @@ def encode_query_params(query) y << "Content-Disposition: form-data" unless key.nil? - name = ERB::Util.url_encode(key.to_s) - y << "; name=\"#{name}\"" + y << "; name=\"#{key}\"" end case val From 34c8c04b937d0249fe49073193997e9311228d8f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 28 Mar 2026 05:52:59 +0000 Subject: [PATCH 5/9] chore(ci): support opting out of skipping builds on metadata-only commits --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 258f17f..8613d52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/amocrm-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: |- github.repository == 'stainless-sdks/amocrm-ruby' && - (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && - (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') + (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 - name: Set up Ruby From e8f546639d827bb38a89df2e42465f9c6d019ea4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 07:05:21 +0000 Subject: [PATCH 6/9] fix: variable name typo --- lib/amocrm/internal/util.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/amocrm/internal/util.rb b/lib/amocrm/internal/util.rb index b90add1..6d8acbf 100644 --- a/lib/amocrm/internal/util.rb +++ b/lib/amocrm/internal/util.rb @@ -157,7 +157,7 @@ def coerce_hash!(input) in Hash | nil => coerced coerced else - message = "Expected a #{Hash} or #{Amocrm::Internal::Type::BaseModel}, got #{data.inspect}" + message = "Expected a #{Hash} or #{Amocrm::Internal::Type::BaseModel}, got #{input.inspect}" raise ArgumentError.new(message) end end From e553b8e0b21dfb819d67c93a63a71009b0f728a8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 07:08:08 +0000 Subject: [PATCH 7/9] fix: align path encoding with RFC 3986 section 3.3 --- lib/amocrm/internal/util.rb | 20 +++++++++++++++++--- rbi/amocrm/internal/util.rbi | 8 ++++++++ sig/amocrm/internal/util.rbs | 4 ++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/amocrm/internal/util.rb b/lib/amocrm/internal/util.rb index 6d8acbf..a84d2ff 100644 --- a/lib/amocrm/internal/util.rb +++ b/lib/amocrm/internal/util.rb @@ -237,6 +237,11 @@ def dig(data, pick, &blk) end end + # @type [Regexp] + # + # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3 + RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/ + class << self # @api private # @@ -247,6 +252,15 @@ def uri_origin(uri) "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}" end + # @api private + # + # @param path [String, Integer] + # + # @return [String] + def encode_path(path) + path.to_s.gsub(Amocrm::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) } + end + # @api private # # @param path [String, Array] @@ -259,7 +273,7 @@ def interpolate_path(path) in [] "" in [String => p, *interpolations] - encoded = interpolations.map { ERB::Util.url_encode(_1) } + encoded = interpolations.map { encode_path(_1) } format(p, *encoded) end end @@ -578,10 +592,10 @@ def encode_query_params(query) case val in Amocrm::FilePart unless val.filename.nil? - filename = ERB::Util.url_encode(val.filename) + filename = encode_path(val.filename) y << "; filename=\"#{filename}\"" in Pathname | IO - filename = ERB::Util.url_encode(::File.basename(val.to_path)) + filename = encode_path(::File.basename(val.to_path)) y << "; filename=\"#{filename}\"" else end diff --git a/rbi/amocrm/internal/util.rbi b/rbi/amocrm/internal/util.rbi index d126d74..cda8601 100644 --- a/rbi/amocrm/internal/util.rbi +++ b/rbi/amocrm/internal/util.rbi @@ -148,12 +148,20 @@ module Amocrm end end + # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3 + RFC_3986_NOT_PCHARS = T.let(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/, Regexp) + class << self # @api private sig { params(uri: URI::Generic).returns(String) } def uri_origin(uri) end + # @api private + sig { params(path: T.any(String, Integer)).returns(String) } + def encode_path(path) + end + # @api private sig { params(path: T.any(String, T::Array[String])).returns(String) } def interpolate_path(path) diff --git a/sig/amocrm/internal/util.rbs b/sig/amocrm/internal/util.rbs index a185d31..a88cc9b 100644 --- a/sig/amocrm/internal/util.rbs +++ b/sig/amocrm/internal/util.rbs @@ -45,8 +45,12 @@ module Amocrm -> top? } -> top? + RFC_3986_NOT_PCHARS: Regexp + def self?.uri_origin: (URI::Generic uri) -> String + def self?.encode_path: (String | Integer path) -> String + def self?.interpolate_path: (String | ::Array[String] path) -> String def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]] From 6e86c5d69289bc86c02b5a8f0d441fa5c7bb2ffc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 08:29:33 +0000 Subject: [PATCH 8/9] fix: multipart encoding for file arrays --- lib/amocrm/internal/util.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/amocrm/internal/util.rb b/lib/amocrm/internal/util.rb index a84d2ff..a50e85e 100644 --- a/lib/amocrm/internal/util.rb +++ b/lib/amocrm/internal/util.rb @@ -612,6 +612,7 @@ def encode_query_params(query) # # @return [Array(String, Enumerable)] private def encode_multipart_streaming(body) + # rubocop:disable Style/CaseEquality # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length boundary = SecureRandom.urlsafe_base64(46) @@ -621,7 +622,7 @@ def encode_query_params(query) in Hash body.each do |key, val| case val - in Array if val.all? { primitive?(_1) } + in Array if val.all? { primitive?(_1) || Amocrm::Internal::Type::FileInput === _1 } val.each do |v| write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing) end @@ -637,6 +638,7 @@ def encode_query_params(query) fused_io = fused_enum(strio) { closing.each(&:call) } [boundary, fused_io] + # rubocop:enable Style/CaseEquality end # @api private From 1259e5110b9a24ec7104ddfc51f09a1e7b8bddcb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 08:29:53 +0000 Subject: [PATCH 9/9] release: 0.5.4 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 19 +++++++++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/amocrm/version.rb | 2 +- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6bc1697..8d0a116 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.3" + ".": "0.5.4" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4833f36..d51e571 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## 0.5.4 (2026-04-09) + +Full Changelog: [v0.5.3...v0.5.4](https://github.com/Hexlet/amocrm-ruby/compare/v0.5.3...v0.5.4) + +### Bug Fixes + +* align path encoding with RFC 3986 section 3.3 ([e553b8e](https://github.com/Hexlet/amocrm-ruby/commit/e553b8e0b21dfb819d67c93a63a71009b0f728a8)) +* **internal:** correct multipart form field name encoding ([4975893](https://github.com/Hexlet/amocrm-ruby/commit/4975893b8eb2d4f427e7d40c07a3b7c1413168fb)) +* multipart encoding for file arrays ([6e86c5d](https://github.com/Hexlet/amocrm-ruby/commit/6e86c5d69289bc86c02b5a8f0d441fa5c7bb2ffc)) +* variable name typo ([e8f5466](https://github.com/Hexlet/amocrm-ruby/commit/e8f546639d827bb38a89df2e42465f9c6d019ea4)) + + +### Chores + +* **ci:** skip lint on metadata-only changes ([dad96e5](https://github.com/Hexlet/amocrm-ruby/commit/dad96e5408642a9781334f2bb4dbc32cd73872d9)) +* **ci:** support opting out of skipping builds on metadata-only commits ([34c8c04](https://github.com/Hexlet/amocrm-ruby/commit/34c8c04b937d0249fe49073193997e9311228d8f)) +* **internal:** tweak CI branches ([9a3e737](https://github.com/Hexlet/amocrm-ruby/commit/9a3e7375b6cca91433c8732e6fa060ecea85519c)) +* **internal:** update gitignore ([9fb96c7](https://github.com/Hexlet/amocrm-ruby/commit/9fb96c78308d30c29ead727cc05a101cdd1b97d1)) + ## 0.5.3 (2026-03-08) Full Changelog: [v0.5.2...v0.5.3](https://github.com/Hexlet/amocrm-ruby/compare/v0.5.2...v0.5.3) diff --git a/Gemfile.lock b/Gemfile.lock index 78c8ad1..1e7bee6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - amocrm (0.5.3) + amocrm (0.5.4) cgi connection_pool diff --git a/README.md b/README.md index fd3e241..e338635 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "amocrm", "~> 0.5.3" +gem "amocrm", "~> 0.5.4" ``` diff --git a/lib/amocrm/version.rb b/lib/amocrm/version.rb index dfb8f0f..b7833c7 100644 --- a/lib/amocrm/version.rb +++ b/lib/amocrm/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Amocrm - VERSION = "0.5.3" + VERSION = "0.5.4" end