eversign-sdk 1.0.0 → 1.0.1

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: b94a150c99afc7c4c96fbab74c828889b50f03934c050cca03338454bd8df6e8
4
- data.tar.gz: 002f2618663a6734dbef74826593998167fe5fdd2894bb74c55596e03e694cb8
3
+ metadata.gz: ee75e5cea6074722f07ec3fb8be8796151ef75b1f4650672087228c389a306fe
4
+ data.tar.gz: 01db4643f3b60ae244239fd571887698f2e26ab83499ad1891361f595b7123b8
5
5
  SHA512:
6
- metadata.gz: 0deef82e6cb7058b536014db30d16eb318e5c5c6e2bc7ebaf879e41ce4f926918ae1079cf56870e20c9e7bf0df932d9de83c97b4f988672c90b6457e0128d3a1
7
- data.tar.gz: b3c4cc76ac2312870663c1802aab0e7714699a5f6e80ff94d9e138f57c863a0f7ad49d61b73fb35e1d0676bdd0f00d2e63d909092fa24499256b5b505eb5d1aa
6
+ metadata.gz: 8d7d9650b75640b2d52efb6bca71e5e37ae27b5cbf9b9787aade09a24fffd9477dc61a07cf5d0336c9b9f92fb95201ca68d7795e9af85e4079ce6866ef75068d
7
+ data.tar.gz: 0bec007c6cdc5d3c2d72c5500c006a0c619959ce720c4043eb3b775b115bc9eceac8474a273119b66db1f04bd665605d990a5e71eb28b171e70a410581706b1e
@@ -0,0 +1,33 @@
1
+ require 'eversign/version'
2
+ require 'configurations'
3
+ require 'addressable/uri'
4
+ require_relative 'eversign/client'
5
+ require_relative 'eversign/models/business'
6
+ require_relative 'eversign/models/file'
7
+ require_relative 'eversign/models/field'
8
+ require_relative 'eversign/models/signer'
9
+ require_relative 'eversign/models/recipient'
10
+ require_relative 'eversign/models/document'
11
+ require_relative 'eversign/models/template'
12
+ require_relative 'eversign/models/error'
13
+ require_relative 'eversign/models/exception'
14
+ require_relative 'eversign/mappings/business'
15
+ require_relative 'eversign/mappings/file'
16
+ require_relative 'eversign/mappings/document'
17
+ require_relative 'eversign/mappings/exception'
18
+
19
+ module Eversign
20
+ include Configurations
21
+ configurable String, :access_key
22
+ configurable Integer, :business_id
23
+ configurable String, :oauth_base
24
+ configurable String, :api_base do |value|
25
+ value ||= 'https://api.eversign.com'
26
+ parsed = Addressable::URI.parse(value)
27
+ if %w(http https).include?(parsed.scheme)
28
+ value
29
+ else
30
+ raise ArgumentError 'Invalid API Base URL'
31
+ end
32
+ end
33
+ end
@@ -154,6 +154,14 @@ module Eversign
154
154
 
155
155
  private
156
156
 
157
+ def append_sdk_id (body)
158
+ unless body.nil?
159
+ bodyHash = JSON.parse(body)
160
+ bodyHash['client'] = 'ruby-sdk'
161
+ return bodyHash.to_json
162
+ end
163
+ end
164
+
157
165
  def execute_request(method, path, body = nil, multipart = false)
158
166
  @faraday ||= Faraday.new(base_uri) do |conn|
159
167
  conn.headers = {}
@@ -163,6 +171,8 @@ module Eversign
163
171
  conn.adapter :net_http
164
172
  end
165
173
 
174
+ body = append_sdk_id(body)
175
+
166
176
  @faraday.send(method) do |request|
167
177
  request.url path
168
178
  request.body = body if body
@@ -1,3 +1,3 @@
1
1
  module Eversign
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eversign-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - eversign
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-09 00:00:00.000000000 Z
11
+ date: 2021-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -157,6 +157,7 @@ executables: []
157
157
  extensions: []
158
158
  extra_rdoc_files: []
159
159
  files:
160
+ - lib/eversign-sdk.rb
160
161
  - lib/eversign.rb
161
162
  - lib/eversign/client.rb
162
163
  - lib/eversign/mappings/business.rb
@@ -192,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
193
  - !ruby/object:Gem::Version
193
194
  version: '0'
194
195
  requirements: []
195
- rubygems_version: 3.1.2
196
+ rubygems_version: 3.0.3
196
197
  signing_key:
197
198
  specification_version: 4
198
199
  summary: Gem for Eversign API Client.