hellosign-api 1.0.3 → 1.0.6
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/CONTRIBUTING.md +1 -1
- data/Gemfile +1 -1
- data/lib/hello_sign/api/template.rb +1 -0
- data/lib/hello_sign/client.rb +3 -3
- data/lib/hello_sign/configuration.rb +1 -1
- data/lib/hello_sign/version.rb +1 -1
- data/lib/{hellosign-ruby-sdk.rb → hellosign-api.rb} +2 -2
- data/spec/fixtures/template_draft.json +7 -0
- data/spec/hello_sign/api/template_spec.rb +32 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4666b6681f4d92b608c07eb22db61bdbd466fb797d83ddd2cd56319ba0607569
|
4
|
+
data.tar.gz: bad67e806000fc4c2c7f33af059c4f92795bec1c1e00382001c9f008bc965a15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c04af622689d244d0a3290af96f2c68e1fe25c033a3567157706a4e66ea46f3d342cf856fd7235eb58bf574f48c8decb18cce69e509ee1bb74c5eafe771a2297
|
7
|
+
data.tar.gz: 64726079c3b8832a85290dc87869cc41132969fb6668ae4a3738c7a64c0a3cdbf78d7eab660b66639beec164b77f594d1d09fe14cd850fb58d1cdbf9a76b78c2
|
data/CONTRIBUTING.md
CHANGED
@@ -6,7 +6,7 @@ We're excited you're considering contributing to our project! Your patches are e
|
|
6
6
|
|
7
7
|
* Make sure you have a [GitHub account](https://github.com/signup/free)
|
8
8
|
* Make sure you have a [HelloSign account](http://www.hellosign.com)
|
9
|
-
* Submit a new [issue ticket](https://github.com/
|
9
|
+
* Submit a new [issue ticket](https://github.com/withgrayce/hellosign-api/issues), assuming one does not already exist.
|
10
10
|
* Clearly describe the issue including steps to reproduce when it is a bug.
|
11
11
|
* Make sure to include the version you are using which has the issue (and confirm that the issue you are having has not been fixed in a later version)
|
12
12
|
* Fork the repository on GitHub
|
data/Gemfile
CHANGED
data/lib/hello_sign/client.rb
CHANGED
@@ -156,11 +156,11 @@ module HelloSign
|
|
156
156
|
|
157
157
|
if options[:no_auth]
|
158
158
|
elsif auth_token
|
159
|
-
connection.authorization
|
159
|
+
connection.request :authorization, 'Bearer', -> { auth_token }
|
160
160
|
elsif api_key
|
161
|
-
connection.
|
161
|
+
connection.request :authorization, :basic, api_key, ''
|
162
162
|
elsif email_address
|
163
|
-
connection.
|
163
|
+
connection.request :authorization, :basic, email_address, password
|
164
164
|
else
|
165
165
|
end
|
166
166
|
if proxy_uri
|
@@ -31,7 +31,7 @@ module HelloSign
|
|
31
31
|
DEFAULT_OAUTH_ENDPOINT = 'https://app.hellosign.com'
|
32
32
|
VALID_OPTIONS_KEYS = [:end_point, :oauth_end_point, :api_version, :user_agent, :client_id, :client_secret, :email_address, :password, :api_key, :auth_token, :log_level, :logging, :proxy_uri, :proxy_user, :proxy_pass, :timeout]
|
33
33
|
|
34
|
-
DEFAULT_USER_AGENT = "hellosign-
|
34
|
+
DEFAULT_USER_AGENT = "hellosign-api/" + HelloSign::VERSION
|
35
35
|
|
36
36
|
attr_accessor *VALID_OPTIONS_KEYS
|
37
37
|
|
data/lib/hello_sign/version.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# A wrapper that allows requiring via the Gemfile name ('hellosign-
|
2
|
-
# This allows you to require either 'hello_sign' (unchanged) or 'hellosign-
|
1
|
+
# A wrapper that allows requiring via the Gemfile name ('hellosign-api')
|
2
|
+
# This allows you to require either 'hello_sign' (unchanged) or 'hellosign-api' in your code
|
3
3
|
|
4
4
|
require 'hello_sign'
|
@@ -169,4 +169,36 @@ describe HelloSign::Api::Template do
|
|
169
169
|
expect(@template.headers).to_not be_nil
|
170
170
|
end
|
171
171
|
end
|
172
|
+
|
173
|
+
describe '#create_embedded_template_draft' do
|
174
|
+
before do
|
175
|
+
stub_post('/template/create_embedded_draft', 'template_draft')
|
176
|
+
@template_draft = HelloSign.create_embedded_template_draft :title => 'Document Test', :file_url => 'http://hellosign.com/test.pdf'
|
177
|
+
end
|
178
|
+
|
179
|
+
it 'should return a Template Draft' do
|
180
|
+
expect(@template_draft).to be_an HelloSign::Resource::TemplateDraft
|
181
|
+
end
|
182
|
+
|
183
|
+
it 'should return response headers' do
|
184
|
+
expect(@template_draft.headers).to_not be_nil
|
185
|
+
end
|
186
|
+
|
187
|
+
context 'with multiple signer_roles' do
|
188
|
+
before do
|
189
|
+
stub_post('/template/create_embedded_draft', 'template_draft')
|
190
|
+
@template_draft = HelloSign.create_embedded_template_draft(
|
191
|
+
:title => 'Document Test',
|
192
|
+
:file_url => 'http://hellosign.com/test.pdf',
|
193
|
+
:signer_roles => [{ :name => 'Employee' }, { :name => 'CEO' }]
|
194
|
+
)
|
195
|
+
end
|
196
|
+
|
197
|
+
it 'should send signer_roles as json' do
|
198
|
+
expect(a_post('/template/create_embedded_draft').with(
|
199
|
+
:body => hash_including({ :signer_roles => [{ :name => 'Employee' }, { :name => 'CEO' }] }))
|
200
|
+
).to have_been_made
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
172
204
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hellosign-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HelloSign, Aubrey Holland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -166,7 +166,7 @@ files:
|
|
166
166
|
- lib/hello_sign/resource/template_draft.rb
|
167
167
|
- lib/hello_sign/resource/unclaimed_draft.rb
|
168
168
|
- lib/hello_sign/version.rb
|
169
|
-
- lib/hellosign-
|
169
|
+
- lib/hellosign-api.rb
|
170
170
|
- spec/fixtures/account.json
|
171
171
|
- spec/fixtures/api_app.json
|
172
172
|
- spec/fixtures/api_apps.json
|
@@ -182,6 +182,7 @@ files:
|
|
182
182
|
- spec/fixtures/signature_requests.json
|
183
183
|
- spec/fixtures/team.json
|
184
184
|
- spec/fixtures/template.json
|
185
|
+
- spec/fixtures/template_draft.json
|
185
186
|
- spec/fixtures/templates.json
|
186
187
|
- spec/fixtures/token.json
|
187
188
|
- spec/fixtures/unclaimed_draft.json
|
@@ -240,6 +241,7 @@ test_files:
|
|
240
241
|
- spec/fixtures/signature_requests.json
|
241
242
|
- spec/fixtures/team.json
|
242
243
|
- spec/fixtures/template.json
|
244
|
+
- spec/fixtures/template_draft.json
|
243
245
|
- spec/fixtures/templates.json
|
244
246
|
- spec/fixtures/token.json
|
245
247
|
- spec/fixtures/unclaimed_draft.json
|