eversign-sdk 0.2.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eversign-sdk.rb +33 -0
- data/lib/eversign/client.rb +13 -0
- data/lib/eversign/mappings/document.rb +2 -1
- data/lib/eversign/models/document.rb +1 -1
- data/lib/eversign/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbda19708b8b958efa3f2971b7ba53ceabb6402a5e7ab73541caed1438dbae55
|
4
|
+
data.tar.gz: 6d831cb4aac774aee7cbdc9261f775e70e1adc436c7c7db2203ac0fc36570427
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3825c4b75b4b5429e67c672cf2e3d0651da62a6353338688d0002fa17de504d727a92c65526d06b8efcbecf2303a307579a5f19d91de2e49394c3384567361fd
|
7
|
+
data.tar.gz: a0665d4a1f0868a17b45d4b09fa7b8571376f8ebd65049831919aa943cdd82c9c611473f7d33bdaa09da18b00fd9498309fd2c028f785c26abf7c1cb65358e9a
|
data/lib/eversign-sdk.rb
ADDED
@@ -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
|
data/lib/eversign/client.rb
CHANGED
@@ -154,6 +154,16 @@ module Eversign
|
|
154
154
|
|
155
155
|
private
|
156
156
|
|
157
|
+
def append_sdk_id (body)
|
158
|
+
begin
|
159
|
+
bodyHash = JSON.parse(body)
|
160
|
+
bodyHash['client'] = 'ruby-sdk'
|
161
|
+
return bodyHash.to_json
|
162
|
+
rescue
|
163
|
+
return body
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
157
167
|
def execute_request(method, path, body = nil, multipart = false)
|
158
168
|
@faraday ||= Faraday.new(base_uri) do |conn|
|
159
169
|
conn.headers = {}
|
@@ -163,6 +173,9 @@ module Eversign
|
|
163
173
|
conn.adapter :net_http
|
164
174
|
end
|
165
175
|
|
176
|
+
body = append_sdk_id(body)
|
177
|
+
|
178
|
+
|
166
179
|
@faraday.send(method) do |request|
|
167
180
|
request.url path
|
168
181
|
request.body = body if body
|
@@ -52,7 +52,8 @@ module Eversign
|
|
52
52
|
|
53
53
|
property :document_hash, :template_id, :sandbox, :is_draft, :title, :message, :use_signer_order, :reminders, :require_all_signers,
|
54
54
|
:redirect, :redirect_decline, :client, :expires, :embedded_signing_enabled, :requester_email, :is_template,
|
55
|
-
:is_completed, :is_archived, :is_deleted, :is_trashed, :is_cancelled, :embedded, :in_person, :permission
|
55
|
+
:is_completed, :is_archived, :is_deleted, :is_trashed, :is_cancelled, :embedded, :in_person, :permission,
|
56
|
+
:use_hidden_tags
|
56
57
|
property :files, plural: true, include: File
|
57
58
|
property :signers, plural: true, include: Signer
|
58
59
|
property :recipients, plural: true, include: Recipient
|
@@ -4,7 +4,7 @@ module Eversign
|
|
4
4
|
attr_accessor :document_hash, :template_id, :sandbox, :is_draft, :title, :message, :use_signer_order, :reminders, :require_all_signers,
|
5
5
|
:redirect, :redirect_decline, :client, :expires, :embedded_signing_enabled, :requester_email, :is_template,
|
6
6
|
:is_completed, :is_archived, :is_deleted, :is_trashed, :is_cancelled, :embedded, :in_person, :permission,
|
7
|
-
:files, :signers, :recipients, :meta, :fields
|
7
|
+
:files, :signers, :recipients, :meta, :fields, :use_hidden_tags
|
8
8
|
|
9
9
|
def add_file(file)
|
10
10
|
self.files ||= []
|
data/lib/eversign/version.rb
CHANGED
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: 0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- eversign
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-01 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
|
@@ -173,11 +174,11 @@ files:
|
|
173
174
|
- lib/eversign/models/signer.rb
|
174
175
|
- lib/eversign/models/template.rb
|
175
176
|
- lib/eversign/version.rb
|
176
|
-
homepage: https://github.com/
|
177
|
+
homepage: https://github.com/eversign/eversign-ruby-sdk
|
177
178
|
licenses:
|
178
179
|
- MIT
|
179
180
|
metadata: {}
|
180
|
-
post_install_message:
|
181
|
+
post_install_message:
|
181
182
|
rdoc_options: []
|
182
183
|
require_paths:
|
183
184
|
- lib
|
@@ -192,8 +193,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
193
|
- !ruby/object:Gem::Version
|
193
194
|
version: '0'
|
194
195
|
requirements: []
|
195
|
-
rubygems_version: 3.
|
196
|
-
signing_key:
|
196
|
+
rubygems_version: 3.2.15
|
197
|
+
signing_key:
|
197
198
|
specification_version: 4
|
198
199
|
summary: Gem for Eversign API Client.
|
199
200
|
test_files: []
|