groupdocs_signature_cloud 23.6 → 23.12

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
- SHA1:
3
- metadata.gz: 5a9e155d4e65d327a47e31fb79021b6005cac762
4
- data.tar.gz: 5479d386acc8a88e461c0925d918b6d97ba0b399
2
+ SHA256:
3
+ metadata.gz: 9aae810064a9e14d5ea2e572b46f76daeec7fb3eebb97edcab6e18c1f08ce15e
4
+ data.tar.gz: 757d773a573e87977d8000fa89d8ee865eff2a1ddd60c22f1347c00c93616d57
5
5
  SHA512:
6
- metadata.gz: f2cbc9ecf69a5cdd5924ecfb7f9537d9e4c2bd29c28687509f105a6f96461796f4bd1b91cae87f417ff0207223a6e9934099135bb827456a9cc8d3a8e25a5f4e
7
- data.tar.gz: 706d97f66c1988343aae5c439a2f50eecfc1825f58bcfa981fba06e21ab7b55de2e8efac53629dc9559e28670ab8ca3bb7a18aa54887eb780ff5c1821b0157f4
6
+ metadata.gz: fc729ddccc4be893eec10bfcab83f0b9d8d83fbf134c43af89de3b97d68510ec692522f391dcf03e4c82fc7c9e6e07538c59519ff379d0a7f604ab7e9c2c0a50
7
+ data.tar.gz: 609dba83cdf122c2f27863c6d1a787d846a9fcd47dcce39260afa71241cf5b377366f07365f35157abb9858bb8c44305123a93de2b0ef8c6f9d0af19e8c82c70
@@ -28,10 +28,9 @@ require 'json'
28
28
  require 'logger'
29
29
  require 'tempfile'
30
30
  require 'faraday'
31
- require 'mimemagic'
32
31
  require 'addressable'
33
32
  require_relative 'version'
34
- require_relative 'api_error'
33
+ require_relative 'api_client_error'
35
34
 
36
35
  module GroupDocsSignatureCloud
37
36
  #
@@ -69,7 +68,7 @@ module GroupDocsSignatureCloud
69
68
  end
70
69
 
71
70
  unless response.success?
72
- raise ApiError.new(:code => response.status, :response_body => response.body)
71
+ raise ApiClientError.new(:code => response.status, :response_body => response.body)
73
72
  end
74
73
 
75
74
  data = deserialize(response, opts[:return_type]) if opts[:return_type]
@@ -111,7 +110,7 @@ module GroupDocsSignatureCloud
111
110
  end
112
111
  end
113
112
 
114
- conn = Faraday.new url, { :params => query_params, :headers => header_params} do |f|
113
+ conn = Faraday.new url, { :params => query_params, :headers => header_params } do |f|
115
114
  f.request :multipart
116
115
  f.request :url_encoded
117
116
  f.adapter Faraday.default_adapter
@@ -283,7 +282,7 @@ module GroupDocsSignatureCloud
283
282
  form_params.each do |key, value|
284
283
  case value
285
284
  when ::File
286
- data[key] = Faraday::UploadIO.new(value.path, MimeMagic.by_magic(value).to_s, key)
285
+ data[key] = Faraday::UploadIO.new(value.path, "application/octet-stream", key)
287
286
  when ::Array, nil
288
287
  data[key] = value
289
288
  else
@@ -25,15 +25,15 @@
25
25
 
26
26
  module GroupDocsSignatureCloud
27
27
  #
28
- # ApiError class for error handling
28
+ # ApiClientError class for error handling
29
29
  #
30
- class ApiError < StandardError
30
+ class ApiClientError < StandardError
31
31
  attr_reader :code
32
32
  attr_reader :message
33
33
 
34
34
  # Usage examples:
35
- # ApiError.new
36
- # ApiError.new(:code => 500, :response_body => "")
35
+ # ApiClientError.new
36
+ # ApiClientError.new(:code => 500, :response_body => "")
37
37
  def initialize(arg = nil)
38
38
  if arg.is_a? Hash
39
39
 
@@ -0,0 +1,272 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="digital_vba.rb">
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsSignatureCloud
31
+
32
+ class DigitalVBA
33
+
34
+ # Gets or sets the password of digital certificate
35
+ attr_accessor :password
36
+
37
+ # Gets or sets the digital certificate file path
38
+ attr_accessor :certificate_file_path
39
+
40
+ # Gets or sets setting of only VBA project signing. If set to true, the SpreadSheet document will not be signed, but the VBA project will be signed.
41
+ attr_accessor :sign_only_vba_project
42
+
43
+ # Gets or sets the signature comments.
44
+ attr_accessor :comments
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'password' => :'Password',
50
+ :'certificate_file_path' => :'CertificateFilePath',
51
+ :'sign_only_vba_project' => :'SignOnlyVBAProject',
52
+ :'comments' => :'Comments'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ :'password' => :'String',
60
+ :'certificate_file_path' => :'String',
61
+ :'sign_only_vba_project' => :'BOOLEAN',
62
+ :'comments' => :'String'
63
+ }
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
+
74
+ if attributes.key?(:'Password')
75
+ self.password = attributes[:'Password']
76
+ end
77
+
78
+ if attributes.key?(:'CertificateFilePath')
79
+ self.certificate_file_path = attributes[:'CertificateFilePath']
80
+ end
81
+
82
+ if attributes.key?(:'SignOnlyVBAProject')
83
+ self.sign_only_vba_project = attributes[:'SignOnlyVBAProject']
84
+ end
85
+
86
+ if attributes.key?(:'Comments')
87
+ self.comments = attributes[:'Comments']
88
+ end
89
+
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properies with the reasons
94
+ def list_invalid_properties
95
+ invalid_properties = []
96
+ if @sign_only_vba_project.nil?
97
+ invalid_properties.push("invalid value for 'sign_only_vba_project', sign_only_vba_project cannot be nil.")
98
+ end
99
+
100
+ return invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ return false if @sign_only_vba_project.nil?
107
+ return true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(other)
113
+ return true if self.equal?(other)
114
+ self.class == other.class &&
115
+ password == other.password &&
116
+ certificate_file_path == other.certificate_file_path &&
117
+ sign_only_vba_project == other.sign_only_vba_project &&
118
+ comments == other.comments
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(other)
124
+ self == other
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Fixnum] Hash code
129
+ def hash
130
+ [password, certificate_file_path, sign_only_vba_project, comments].hash
131
+ end
132
+
133
+ # Downcases first letter.
134
+ # @return downcased string
135
+ def uncap(str)
136
+ str[0, 1].downcase + str[1..-1]
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ self.class.swagger_types.each_pair do |key, type|
145
+ pname = uncap(self.class.attribute_map[key]).intern
146
+ value = attributes[pname]
147
+ if type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the the attribute
149
+ # is documented as an array but the input is not
150
+ if value.is_a?(Array)
151
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !value.nil?
154
+ self.send("#{key}=", _deserialize(type, value))
155
+ end
156
+ # or else data not found in attributes(hash), not an issue as the data can be optional
157
+ end
158
+
159
+ self
160
+ end
161
+
162
+ # Deserializes the data based on type
163
+ # @param string type Data type
164
+ # @param string value Value to be deserialized
165
+ # @return [Object] Deserialized data
166
+ def _deserialize(type, value)
167
+ case type.to_sym
168
+ when :DateTime
169
+ Date.parse value
170
+ when :Date
171
+ Date.parse value
172
+ when :String
173
+ value.to_s
174
+ when :Integer
175
+ value.to_i
176
+ when :Float
177
+ value.to_f
178
+ when :BOOLEAN
179
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
180
+ true
181
+ else
182
+ false
183
+ end
184
+ when :Object
185
+ # generic object (usually a Hash), return directly
186
+ value
187
+ when /\AArray<(?<inner_type>.+)>\z/
188
+ inner_type = Regexp.last_match[:inner_type]
189
+ value.map { |v| _deserialize(inner_type, v) }
190
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
191
+ k_type = Regexp.last_match[:k_type]
192
+ v_type = Regexp.last_match[:v_type]
193
+ {}.tap do |hash|
194
+ value.each do |k, v|
195
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
196
+ end
197
+ end
198
+ else
199
+ # model
200
+ # Signature type fix
201
+ ttype = type
202
+ if value.is_a?(Hash) and !value[:signatureType].nil?
203
+ ttype = value[:signatureType] + 'Signature'
204
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
205
+ type = value[:type]
206
+ if type == 'Checkbox'
207
+ ttype = 'CheckboxFormFieldSignature'
208
+ end
209
+ if type == 'Text'
210
+ ttype = 'TextFormFieldSignature'
211
+ end
212
+ if type == 'Combobox'
213
+ ttype = 'ComboboxFormFieldSignature'
214
+ end
215
+ if type == 'DigitalSignature'
216
+ ttype = 'DigitalFormFieldSignature'
217
+ end
218
+ if type == 'Radio'
219
+ ttype = 'RadioButtonFormFieldSignature'
220
+ end
221
+ end
222
+ end
223
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
224
+ temp_model.build_from_hash(value)
225
+ end
226
+ end
227
+
228
+ # Returns the string representation of the object
229
+ # @return [String] String presentation of the object
230
+ def to_s
231
+ to_hash.to_s
232
+ end
233
+
234
+ # to_body is an alias to to_hash (backward compatibility)
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_body
237
+ to_hash
238
+ end
239
+
240
+ # Returns the object in the form of hash
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_hash
243
+ hash = {}
244
+ self.class.attribute_map.each_pair do |attr, param|
245
+ value = self.send(attr)
246
+ next if value.nil?
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ # Outputs non-array value in the form of hash
253
+ # For object, use to_hash. Otherwise, just return the value
254
+ # @param [Object] value Any valid value
255
+ # @return [Hash] Returns the value in the form of hash
256
+ def _to_hash(value)
257
+ if value.is_a?(Array)
258
+ value.compact.map { |v| _to_hash(v) }
259
+ elsif value.is_a?(Hash)
260
+ {}.tap do |hash|
261
+ value.each { |k, v| hash[k] = _to_hash(v) }
262
+ end
263
+ elsif value.respond_to? :to_hash
264
+ value.to_hash
265
+ else
266
+ value
267
+ end
268
+ end
269
+
270
+ end
271
+
272
+ end
@@ -108,6 +108,9 @@ module GroupDocsSignatureCloud
108
108
 
109
109
  # XAdES type GroupDocs.Signature.Options.DigitalSignOptions.XAdESType. Default value is None (XAdES is off). At this moment XAdES signature type is supported only for Spreadsheet documents.
110
110
  attr_accessor :x_ad_es_type
111
+
112
+ # Options for signing VBA project
113
+ attr_accessor :digital_vba
111
114
  class EnumAttributeValidator
112
115
  attr_reader :datatype
113
116
  attr_reader :allowable_values
@@ -158,7 +161,8 @@ module GroupDocsSignatureCloud
158
161
  :'visible' => :'Visible',
159
162
  :'password' => :'Password',
160
163
  :'certificate_file_path' => :'CertificateFilePath',
161
- :'x_ad_es_type' => :'XAdESType'
164
+ :'x_ad_es_type' => :'XAdESType',
165
+ :'digital_vba' => :'DigitalVBA'
162
166
  }
163
167
  end
164
168
 
@@ -190,7 +194,8 @@ module GroupDocsSignatureCloud
190
194
  :'visible' => :'BOOLEAN',
191
195
  :'password' => :'String',
192
196
  :'certificate_file_path' => :'String',
193
- :'x_ad_es_type' => :'String'
197
+ :'x_ad_es_type' => :'String',
198
+ :'digital_vba' => :'DigitalVBA'
194
199
  }
195
200
  end
196
201
 
@@ -306,6 +311,10 @@ module GroupDocsSignatureCloud
306
311
  self.x_ad_es_type = attributes[:'XAdESType']
307
312
  end
308
313
 
314
+ if attributes.key?(:'DigitalVBA')
315
+ self.digital_vba = attributes[:'DigitalVBA']
316
+ end
317
+
309
318
  end
310
319
 
311
320
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -538,7 +547,8 @@ module GroupDocsSignatureCloud
538
547
  visible == other.visible &&
539
548
  password == other.password &&
540
549
  certificate_file_path == other.certificate_file_path &&
541
- x_ad_es_type == other.x_ad_es_type
550
+ x_ad_es_type == other.x_ad_es_type &&
551
+ digital_vba == other.digital_vba
542
552
  end
543
553
 
544
554
  # @see the `==` method
@@ -550,7 +560,7 @@ module GroupDocsSignatureCloud
550
560
  # Calculates hash code according to all attributes.
551
561
  # @return [Fixnum] Hash code
552
562
  def hash
553
- [signature_type, page, all_pages, pages_setup, appearance, image_file_path, left, top, width, height, location_measure_type, size_measure_type, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, transparency, border, reason, contact, location, visible, password, certificate_file_path, x_ad_es_type].hash
563
+ [signature_type, page, all_pages, pages_setup, appearance, image_file_path, left, top, width, height, location_measure_type, size_measure_type, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, transparency, border, reason, contact, location, visible, password, certificate_file_path, x_ad_es_type, digital_vba].hash
554
564
  end
555
565
 
556
566
  # Downcases first letter.
@@ -25,5 +25,5 @@
25
25
  # --------------------------------------------------------------------------------------------------------------------
26
26
  #
27
27
  module GroupDocsSignatureCloud
28
- VERSION = "23.6".freeze
28
+ VERSION = "23.12".freeze
29
29
  end
@@ -25,7 +25,7 @@
25
25
 
26
26
  # Common files
27
27
  require_relative 'groupdocs_signature_cloud/api_client'
28
- require_relative 'groupdocs_signature_cloud/api_error'
28
+ require_relative 'groupdocs_signature_cloud/api_client_error'
29
29
  require_relative 'groupdocs_signature_cloud/version'
30
30
  require_relative 'groupdocs_signature_cloud/configuration'
31
31
 
@@ -39,6 +39,7 @@ require_relative 'groupdocs_signature_cloud/models/color'
39
39
  require_relative 'groupdocs_signature_cloud/models/consumption_result'
40
40
  require_relative 'groupdocs_signature_cloud/models/delete_options'
41
41
  require_relative 'groupdocs_signature_cloud/models/delete_result'
42
+ require_relative 'groupdocs_signature_cloud/models/digital_vba'
42
43
  require_relative 'groupdocs_signature_cloud/models/disc_usage'
43
44
  require_relative 'groupdocs_signature_cloud/models/error'
44
45
  require_relative 'groupdocs_signature_cloud/models/error_details'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groupdocs_signature_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: '23.6'
4
+ version: '23.12'
5
5
  platform: ruby
6
6
  authors:
7
7
  - GroupDocs
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-23 00:00:00.000000000 Z
11
+ date: 2023-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -30,20 +30,20 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.8.0
33
+ version: 2.8.4
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 2.8.0
36
+ version: 2.8.4
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: 2.8.0
43
+ version: 2.8.4
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 2.8.0
46
+ version: 2.8.4
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: minitest
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -79,7 +79,7 @@ files:
79
79
  - lib/groupdocs_signature_cloud/api/sign_api.rb
80
80
  - lib/groupdocs_signature_cloud/api/storage_api.rb
81
81
  - lib/groupdocs_signature_cloud/api_client.rb
82
- - lib/groupdocs_signature_cloud/api_error.rb
82
+ - lib/groupdocs_signature_cloud/api_client_error.rb
83
83
  - lib/groupdocs_signature_cloud/configuration.rb
84
84
  - lib/groupdocs_signature_cloud/models/barcode_signature.rb
85
85
  - lib/groupdocs_signature_cloud/models/barcode_type.rb
@@ -97,6 +97,7 @@ files:
97
97
  - lib/groupdocs_signature_cloud/models/digital_form_field_signature.rb
98
98
  - lib/groupdocs_signature_cloud/models/digital_signature.rb
99
99
  - lib/groupdocs_signature_cloud/models/digital_signature_appearance.rb
100
+ - lib/groupdocs_signature_cloud/models/digital_vba.rb
100
101
  - lib/groupdocs_signature_cloud/models/disc_usage.rb
101
102
  - lib/groupdocs_signature_cloud/models/error.rb
102
103
  - lib/groupdocs_signature_cloud/models/error_details.rb
@@ -174,7 +175,7 @@ licenses:
174
175
  - MIT
175
176
  metadata:
176
177
  source_code_uri: https://github.com/groupdocs-signature-cloud/groupdocs-signature-cloud-ruby
177
- post_install_message:
178
+ post_install_message:
178
179
  rdoc_options: []
179
180
  require_paths:
180
181
  - lib
@@ -189,9 +190,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
190
  - !ruby/object:Gem::Version
190
191
  version: '0'
191
192
  requirements: []
192
- rubyforge_project:
193
- rubygems_version: 2.6.14.1
194
- signing_key:
193
+ rubygems_version: 3.1.6
194
+ signing_key:
195
195
  specification_version: 4
196
196
  summary: GroupDocs.Signature Cloud Ruby SDK
197
197
  test_files: []