hellosign-api 1.0.3 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01a147dec95c544e8a9b8c09159bc6aefa88b03fd5e0ca285012f8656ad4ac2a
4
- data.tar.gz: 45e0fd7ca2d7407947ea53a2473203a9f84028e2f7256760b1bdda63c7abc816
3
+ metadata.gz: 4666b6681f4d92b608c07eb22db61bdbd466fb797d83ddd2cd56319ba0607569
4
+ data.tar.gz: bad67e806000fc4c2c7f33af059c4f92795bec1c1e00382001c9f008bc965a15
5
5
  SHA512:
6
- metadata.gz: b410f70babd8b79105eb7adf7a63bebb9801a39dbda0c3e63ddd82706d57038ed99e706eed39e1e16d683879094682d09217e2d46aacac9da2795d7ac93750d5
7
- data.tar.gz: be22585830d5cb21e3754ba7a44870cc5162d751bfc329b696ec164b5bd991b7f0d3ad2aa0b2b599f1df8dc8a0d1bb09f3ed0bcafee32c4c3ca3f94daba3c343
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/HelloFax/hellosign-ruby-sdk/issues), assuming one does not already exist.
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
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in hello_sign.gemspec
3
+ # Specify your gem's dependencies in hellosign-api.gemspec
4
4
  gemspec
5
5
 
6
6
  group :development, :spec do
@@ -176,6 +176,7 @@ module HelloSign
176
176
  prepare_files opts
177
177
  prepare_signer_roles opts
178
178
  prepare_attachments opts
179
+ prepare_merge_fields opts
179
180
  HelloSign::Resource::TemplateDraft.new post("/template/create_embedded_draft", body: opts)
180
181
  end
181
182
 
@@ -156,11 +156,11 @@ module HelloSign
156
156
 
157
157
  if options[:no_auth]
158
158
  elsif auth_token
159
- connection.authorization :Bearer, auth_token
159
+ connection.request :authorization, 'Bearer', -> { auth_token }
160
160
  elsif api_key
161
- connection.basic_auth api_key, ''
161
+ connection.request :authorization, :basic, api_key, ''
162
162
  elsif email_address
163
- connection.basic_auth email_address, password
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-ruby-sdk/" + HelloSign::VERSION
34
+ DEFAULT_USER_AGENT = "hellosign-api/" + HelloSign::VERSION
35
35
 
36
36
  attr_accessor *VALID_OPTIONS_KEYS
37
37
 
@@ -21,5 +21,5 @@
21
21
  # SOFTWARE.
22
22
 
23
23
  module HelloSign
24
- VERSION = '1.0.3'
24
+ VERSION = '1.0.6'
25
25
  end
@@ -1,4 +1,4 @@
1
- # A wrapper that allows requiring via the Gemfile name ('hellosign-ruby-sdk')
2
- # This allows you to require either 'hello_sign' (unchanged) or 'hellosign-ruby-sdk' in your code
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'
@@ -0,0 +1,7 @@
1
+ {
2
+ "template": {
3
+ "template_id": "a364138e0d8ae6393aa425a8ec64715580f3748b",
4
+ "edit_url": "https://embedded.hellosign.com/prep-and-send/embedded-template?cached_params_token=xxxxxxxxx",
5
+ "expires_at": 1649096573
6
+ }
7
+ }
@@ -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.3
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-03-10 00:00:00.000000000 Z
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-ruby-sdk.rb
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