boldsign 0.5.0 → 0.6.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: 9fc744443078d2ffab4156204b7921ef617c3788d373253956a0fe9f3455a14a
4
- data.tar.gz: 133c334403bb3a2655f61ab7c14f8d9d75c9e3adf5212f9bdf7e69811a2cda2a
3
+ metadata.gz: 1f5158801c4b85358c9f7b45376a2767bb98c3374e994b2cb643840245ce641f
4
+ data.tar.gz: d4748c0000aabf9012b0d0403ca54d147a5bf190674cf80c96079302fa97dd95
5
5
  SHA512:
6
- metadata.gz: 96e5622f76bf23b2df6be9663542fb0db5da070f40480e6649960da33d336c14afcafc36c308b5dad867fa4ce90ab3faf574c3c956011c330c7599713cf3afe2
7
- data.tar.gz: 640539d3b260f4b50de92bddca66ed45a794c0c54c722d32d807134eee505d06f737542d077403ab71f5699f23e106567d1bf19dfb4954420398904e9cd756e2
6
+ metadata.gz: 7b8e468b7897ee9a34c9bed4256cd2fd305a58e43af9ab07c889de9ad5c024d8da6e7b01b4bc1d3ca572e5b785b786ebc9544b4559797b7e95d96cc01cb493ea
7
+ data.tar.gz: 29670ea3951d2adade1a687d6786510409e48707d27844dedc07b2659637b3ea7c5089672ea1f9d550e7fced26d89fcd2f98c4bea29ae324430e83652d807550
data/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.6.0] — 2026-07-27
11
+
12
+ ### Added
13
+ - Multi-signer support for multipart `send_document` (file uploads). Array-valued
14
+ body fields (e.g. `signers: [...]`) now emit one JSON-object part per element,
15
+ all under the same field name (`Signers`, `Signers`, …) via
16
+ `Faraday::Multipart::Middleware`'s `flat_encode: true` — confirmed against
17
+ BoldSign's docs as the correct encoding for a multi-recipient envelope sent
18
+ alongside an uploaded file (as opposed to a template reference). Previously
19
+ this raised `NotImplementedError`. Multi-file uploads are still unsupported
20
+ and still raise.
21
+
10
22
  ## [0.5.0] — 2026-06-02
11
23
 
12
24
  ### Added
@@ -90,6 +102,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
90
102
  - 100% line and branch test coverage enforced via SimpleCov.
91
103
  - GitHub Actions CI on Ruby 3.4 and 4.0.
92
104
 
93
- [Unreleased]: https://github.com/kleinjm/boldsign-ruby/compare/v0.5.0...HEAD
94
- [0.5.0]: https://github.com/kleinjm/boldsign-ruby/compare/v0.4.0...v0.5.0
95
- [0.1.0]: https://github.com/kleinjm/boldsign-ruby/releases/tag/v0.1.0
105
+ [Unreleased]: https://github.com/EscrowSafe/boldsign-ruby/compare/v0.6.0...HEAD
106
+ [0.6.0]: https://github.com/EscrowSafe/boldsign-ruby/compare/v0.5.0...v0.6.0
107
+ [0.5.0]: https://github.com/EscrowSafe/boldsign-ruby/compare/v0.4.0...v0.5.0
108
+ [0.1.0]: https://github.com/EscrowSafe/boldsign-ruby/releases/tag/v0.1.0
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # boldsign-ruby
2
2
 
3
- [![CI](https://github.com/kleinjm/boldsign-ruby/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/kleinjm/boldsign-ruby/actions/workflows/ci.yml)
4
- [![API docs](https://img.shields.io/badge/docs-rubydoc.info-blue.svg)](https://rubydoc.info/github/kleinjm/boldsign-ruby/main)
3
+ [![CI](https://github.com/EscrowSafe/boldsign-ruby/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/EscrowSafe/boldsign-ruby/actions/workflows/ci.yml)
4
+ [![API docs](https://img.shields.io/badge/docs-rubydoc.info-blue.svg)](https://rubydoc.info/github/EscrowSafe/boldsign-ruby/main)
5
5
 
6
6
  A Ruby client for the [BoldSign](https://developers.boldsign.com/) e-signature API.
7
7
 
@@ -138,7 +138,7 @@ HTTP errors raise a typed subclass of `Boldsign::Error`:
138
138
  ## Documentation
139
139
 
140
140
  Full YARD API documentation is auto-built and hosted at
141
- [rubydoc.info/github/kleinjm/boldsign-ruby/main](https://rubydoc.info/github/kleinjm/boldsign-ruby/main).
141
+ [rubydoc.info/github/EscrowSafe/boldsign-ruby/main](https://rubydoc.info/github/EscrowSafe/boldsign-ruby/main).
142
142
 
143
143
  To generate locally:
144
144
 
data/boldsign.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.summary = "Ruby client for the BoldSign e-signature API"
10
10
  spec.description = "A Ruby wrapper for the BoldSign REST API (documents, templates, " \
11
11
  "contacts, teams, brands, webhooks, and more)."
12
- spec.homepage = "https://github.com/kleinjm/boldsign-ruby"
12
+ spec.homepage = "https://github.com/EscrowSafe/boldsign-ruby"
13
13
  spec.license = "MIT"
14
14
  spec.required_ruby_version = ">= 3.0"
15
15
 
@@ -172,7 +172,13 @@ module Boldsign
172
172
 
173
173
  def connection(multipart: false)
174
174
  Faraday.new(url: @base_url) do |f|
175
- f.request :multipart if multipart
175
+ # flat_encode: true makes Faraday::Multipart::Middleware emit each
176
+ # Array element as its own part under the *same* field name (e.g. two
177
+ # `Signers` parts) instead of bracket-suffixing it (`Signers[]=`),
178
+ # which BoldSign's /v1/document/send endpoint rejects. See
179
+ # Resources::Document#encode_multipart_value, the caller that relies
180
+ # on this.
181
+ f.request :multipart, flat_encode: true if multipart
176
182
  f.request :url_encoded
177
183
  apply_auth(f.headers)
178
184
  f.headers["Accept"] = "application/json"
@@ -74,13 +74,16 @@ module Boldsign
74
74
  private
75
75
 
76
76
  # BoldSign's POST /v1/document/send multipart endpoint is fussy about
77
- # repeated/array-valued parts. Single signers must be sent as one
78
- # multipart part whose value is the signer JSON OBJECT (not a JSON array
79
- # containing one object). Files must be sent as a single FilePart value
80
- # for one upload; Faraday's automatic `Files[]` bracketing breaks the
81
- # request. For the single-signer, single-file flow (the common case) we
82
- # unwrap one-element arrays here. Multi-signer / multi-file is not yet
83
- # supported via this helper and will raise.
77
+ # repeated/array-valued parts. Multi-valued fields (e.g. two signers)
78
+ # must be sent as one multipart part per element, each keyed with the
79
+ # *same* field name and JSON-encoding just that one element not a
80
+ # single field whose value is a JSON array, and not Faraday's default
81
+ # `Signers[]=` bracket-suffixed encoding (BoldSign rejects both). See
82
+ # `Client#connection`'s `flat_encode: true`, which is what makes
83
+ # `encode_multipart_value`'s Array output emit that way. Files must be
84
+ # sent as a single FilePart value for one upload; Faraday's automatic
85
+ # `Files[]` bracketing breaks the request the same way. Multi-file is
86
+ # not yet supported via this helper and will raise.
84
87
  def multipart_send_body(body, files)
85
88
  parts = body.each_with_object({}) do |(key, value), acc|
86
89
  next if value.nil?
@@ -95,12 +98,15 @@ module Boldsign
95
98
  parts
96
99
  end
97
100
 
101
+ # Scalars pass through as-is. A Hash (or single-element Array, once
102
+ # `flat_encode` unwraps it to one part) becomes one JSON-object part.
103
+ # A multi-element Array becomes one JSON-object part *per element*,
104
+ # all sharing the same field name — see `multipart_send_body`'s comment.
98
105
  def encode_multipart_value(value)
99
106
  return value.to_s if scalar?(value)
100
- return JSON.generate(Boldsign::CaseConvert.camelize(value)) unless value.is_a?(Array)
101
- raise NotImplementedError, "multi-element arrays are not supported in multipart bodies yet" if value.size > 1
107
+ return value.map { |v| JSON.generate(Boldsign::CaseConvert.camelize(v)) } if value.is_a?(Array)
102
108
 
103
- JSON.generate(Boldsign::CaseConvert.camelize(value.first))
109
+ JSON.generate(Boldsign::CaseConvert.camelize(value))
104
110
  end
105
111
 
106
112
  def file_part(file)
@@ -1,3 +1,3 @@
1
1
  module Boldsign
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boldsign
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Klein
@@ -109,14 +109,14 @@ files:
109
109
  - lib/boldsign/resources/template.rb
110
110
  - lib/boldsign/resources/user.rb
111
111
  - lib/boldsign/version.rb
112
- homepage: https://github.com/kleinjm/boldsign-ruby
112
+ homepage: https://github.com/EscrowSafe/boldsign-ruby
113
113
  licenses:
114
114
  - MIT
115
115
  metadata:
116
- homepage_uri: https://github.com/kleinjm/boldsign-ruby
117
- source_code_uri: https://github.com/kleinjm/boldsign-ruby
118
- changelog_uri: https://github.com/kleinjm/boldsign-ruby/blob/main/CHANGELOG.md
119
- bug_tracker_uri: https://github.com/kleinjm/boldsign-ruby/issues
116
+ homepage_uri: https://github.com/EscrowSafe/boldsign-ruby
117
+ source_code_uri: https://github.com/EscrowSafe/boldsign-ruby
118
+ changelog_uri: https://github.com/EscrowSafe/boldsign-ruby/blob/main/CHANGELOG.md
119
+ bug_tracker_uri: https://github.com/EscrowSafe/boldsign-ruby/issues
120
120
  documentation_uri: https://rubydoc.info/gems/boldsign
121
121
  rubygems_mfa_required: 'true'
122
122
  rdoc_options: []