rs4 0.2.9 → 0.2.14
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/lib/rs4/document.rb +3 -3
- data/lib/rs4/request.rb +3 -1
- data/lib/rs4/reusable_template.rb +22 -4
- data/lib/rs4/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a5fa2a84fe9ba420f0fa1290e8db8924d01b8b072f2d1ab348e57da66108063
|
4
|
+
data.tar.gz: 67aca3df9920d1db59fe4b5285047d903022f4f3b81bef2716afd9498a5e14b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db4a76f516321f6aa578bd298d9a03ee9eaa25279a6a9406afcb5eb72e50df94633079da150f60aae042aa21574789e914d5d88efa416f6326946509698c3dfb
|
7
|
+
data.tar.gz: ceb3c9d858bd45e6924f0d3fcbb9989a168326060e086e215ba567c63d8bf9833e0712dd26fd006ae313d20f7da6578499b6034a0c962b543c3666727a2334c1
|
data/lib/rs4/document.rb
CHANGED
@@ -86,7 +86,7 @@ module RS4
|
|
86
86
|
def get_archive_document(document_guid)
|
87
87
|
return unless document_guid.present?
|
88
88
|
|
89
|
-
path = "archived_documents_by_original_guid/#{document_guid}"
|
89
|
+
path = "/public/v1/archived_documents_by_original_guid/#{document_guid}"
|
90
90
|
|
91
91
|
response = RS4.configuration.request_handler.execute(path, :get)
|
92
92
|
|
@@ -100,7 +100,7 @@ module RS4
|
|
100
100
|
def get_document(document_guid)
|
101
101
|
return unless document_guid.present?
|
102
102
|
|
103
|
-
path = "documents/#{document_guid}"
|
103
|
+
path = "/public/v1/documents/#{document_guid}"
|
104
104
|
|
105
105
|
response = RS4.configuration.request_handler.execute(path, :get)
|
106
106
|
|
@@ -113,7 +113,7 @@ module RS4
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def get_documents
|
116
|
-
path = 'documents'
|
116
|
+
path = '/public/v1/documents'
|
117
117
|
response = RS4.configuration.request_handler.execute(path, :get)
|
118
118
|
|
119
119
|
unless response.is_a?(RS4::Error) || response.nil?
|
data/lib/rs4/request.rb
CHANGED
@@ -12,7 +12,9 @@ module RS4
|
|
12
12
|
return RS4::ConfigurationError.new(RS4.configuration.errors, 'Invalid Configuration')
|
13
13
|
end
|
14
14
|
|
15
|
-
url = URI(RS4.configuration.api_host +
|
15
|
+
url = URI(RS4.configuration.api_host + path)
|
16
|
+
|
17
|
+
Rails.logger.info("#{RS4.configuration.api_host}#{path}")
|
16
18
|
|
17
19
|
http = Net::HTTP.new(url.host, url.port)
|
18
20
|
http.use_ssl = true
|
@@ -46,7 +46,7 @@ module RS4
|
|
46
46
|
def get_reusable_template(template_guid)
|
47
47
|
return unless template_guid
|
48
48
|
|
49
|
-
path = "reusable_templates/#{template_guid}"
|
49
|
+
path = "/public/v1/reusable_templates/#{template_guid}"
|
50
50
|
|
51
51
|
response = RS4.configuration.request_handler.execute(path, :get)
|
52
52
|
|
@@ -60,7 +60,7 @@ module RS4
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def get_reusable_templates(options = {})
|
63
|
-
base_path = 'reusable_templates'
|
63
|
+
base_path = '/public/v1/reusable_templates'
|
64
64
|
|
65
65
|
query = CGI.unescape(options.to_query)
|
66
66
|
|
@@ -69,8 +69,26 @@ module RS4
|
|
69
69
|
RS4.configuration.request_handler.execute(path, :get)
|
70
70
|
end
|
71
71
|
|
72
|
+
def prepare_document(template_guid, options = {})
|
73
|
+
path = "/public/v1/reusable_templates/#{template_guid}/prepare_document"
|
74
|
+
|
75
|
+
body = options
|
76
|
+
|
77
|
+
response = RS4.configuration.request_handler.execute(path, :post, body)
|
78
|
+
|
79
|
+
Rails.logger.info("RS4::ReusableTemplate::embed_document:: #{response.inspect}")
|
80
|
+
|
81
|
+
unless response.is_a?(RS4::Error) || response.nil?
|
82
|
+
# parsed_response = JSON.parse(response.read_body, symbolize_names: true)
|
83
|
+
|
84
|
+
document_hash = response.dig(:document)
|
85
|
+
|
86
|
+
return RS4::Document.new(document_hash)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
72
90
|
def embed_document(template_guid, options = {})
|
73
|
-
path = "reusable_templates/#{template_guid}/embed_document"
|
91
|
+
path = "/public/v1/reusable_templates/#{template_guid}/embed_document"
|
74
92
|
|
75
93
|
body = options
|
76
94
|
|
@@ -88,7 +106,7 @@ module RS4
|
|
88
106
|
end
|
89
107
|
|
90
108
|
def send_document(template_guid, options = {})
|
91
|
-
path = "reusable_templates/#{template_guid}/send_document"
|
109
|
+
path = "/public/v1/reusable_templates/#{template_guid}/send_document"
|
92
110
|
|
93
111
|
body = options
|
94
112
|
|
data/lib/rs4/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rs4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- donny
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Provides ruby access to CRUD operations for RightSignature documents
|
14
14
|
and reusable templates
|