rs4 0.2.4 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rs4/document.rb +30 -0
- data/lib/rs4/reusable_template.rb +36 -2
- 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: 6cd3573256b8d264675f04900247bb93fb4c43c9ff48abe2aef7afbee8b5f065
|
4
|
+
data.tar.gz: 6919e7bd96d8744167688f541e4534fdda597833978dafafcaf4818c19ba7fde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 357f20886ff704e94067bb0f316f3d04f96b4e30205bdfbef84936e811d1cb3a294a9624c0f554346fbb97a428d02e872c5f654374e8e921d5bdce25a0d152a0
|
7
|
+
data.tar.gz: 91224d46bc1dc7c03f1fa7991211fde1b3038cbea078b7b32a1bca4c3c709c3f51220453c7477e5fde9107c63f4a3121ba5cfb75e8a498328ad0acdfe04dfc4d
|
data/lib/rs4/document.rb
CHANGED
@@ -112,6 +112,36 @@ module RS4
|
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
+
def post_force_complete(document_guid)
|
116
|
+
return unless document_guid.present?
|
117
|
+
|
118
|
+
path = "documents/#{document_guid}/force_complete"
|
119
|
+
|
120
|
+
response = RS4.configuration.request_handler.execute(path, :post)
|
121
|
+
|
122
|
+
unless response.is_a?(RS4::Error) || response.nil? # .class == Net::HTTPOK
|
123
|
+
raw_document = response.dig(:document) # JSON.parse(response.body, symbolize_names: true)
|
124
|
+
|
125
|
+
# Document.new(raw_document[:document])
|
126
|
+
Document.new(raw_document) if raw_document
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def get_force_complete(document_guid)
|
131
|
+
return unless document_guid.present?
|
132
|
+
|
133
|
+
path = "documents/#{document_guid}/force_complete"
|
134
|
+
|
135
|
+
response = RS4.configuration.request_handler.execute(path, :get)
|
136
|
+
|
137
|
+
unless response.is_a?(RS4::Error) || response.nil? # .class == Net::HTTPOK
|
138
|
+
raw_document = response.dig(:document) # JSON.parse(response.body, symbolize_names: true)
|
139
|
+
|
140
|
+
# Document.new(raw_document[:document])
|
141
|
+
Document.new(raw_document) if raw_document
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
115
145
|
def get_documents
|
116
146
|
path = 'documents'
|
117
147
|
response = RS4.configuration.request_handler.execute(path, :get)
|
@@ -69,13 +69,47 @@ 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 = "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
|
+
|
90
|
+
def embed_document(template_guid, options = {})
|
91
|
+
path = "reusable_templates/#{template_guid}/embed_document"
|
92
|
+
|
93
|
+
body = options
|
94
|
+
|
95
|
+
response = RS4.configuration.request_handler.execute(path, :post, body)
|
96
|
+
|
97
|
+
Rails.logger.info("RS4::ReusableTemplate::embed_document:: #{response.inspect}")
|
98
|
+
|
99
|
+
unless response.is_a?(RS4::Error) || response.nil?
|
100
|
+
# parsed_response = JSON.parse(response.read_body, symbolize_names: true)
|
101
|
+
|
102
|
+
document_hash = response.dig(:document)
|
103
|
+
|
104
|
+
return RS4::Document.new(document_hash)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
72
108
|
def send_document(template_guid, options = {})
|
73
109
|
path = "reusable_templates/#{template_guid}/send_document"
|
74
110
|
|
75
111
|
body = options
|
76
112
|
|
77
|
-
body[:in_person] = true
|
78
|
-
|
79
113
|
response = RS4.configuration.request_handler.execute(path, :post, body)
|
80
114
|
|
81
115
|
Rails.logger.info("RS4::ReusableTemplate::send_document:: #{response.inspect}")
|
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.11
|
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
|