rs4 0.2.4 → 0.2.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98cdd324402202c22dced91d438c470bb032f16c689155b6e73bf6932a459094
4
- data.tar.gz: 13c521a87135c796fec0aa2f6df17a1812452cbb7fee182607ebca47f5bc6873
3
+ metadata.gz: 6cd3573256b8d264675f04900247bb93fb4c43c9ff48abe2aef7afbee8b5f065
4
+ data.tar.gz: 6919e7bd96d8744167688f541e4534fdda597833978dafafcaf4818c19ba7fde
5
5
  SHA512:
6
- metadata.gz: '097d79e1a17b7b56e57a96031cf7d1e3afe80ad60c9dd2f09f92ae209dd7d90acddc56f4728cc2e5605977552bcef3739d1fffb9f0f77a410e5d8de8508b5965'
7
- data.tar.gz: d24c5abb6e34b9b780b9dfe3cdb1e70aeb8128fec520d24bc9f16e8a65796d9762124cebad3ab5ae25fb99e7a74c2e834d0e64638af01a3fb104e9bb868950a5
6
+ metadata.gz: 357f20886ff704e94067bb0f316f3d04f96b4e30205bdfbef84936e811d1cb3a294a9624c0f554346fbb97a428d02e872c5f654374e8e921d5bdce25a0d152a0
7
+ data.tar.gz: 91224d46bc1dc7c03f1fa7991211fde1b3038cbea078b7b32a1bca4c3c709c3f51220453c7477e5fde9107c63f4a3121ba5cfb75e8a498328ad0acdfe04dfc4d
@@ -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}")
@@ -1,3 +1,3 @@
1
1
  module RS4
2
- VERSION = '0.2.4'.freeze
2
+ VERSION = '0.2.11'.freeze
3
3
  end
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
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-02 00:00:00.000000000 Z
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