Skip to content

Commit b617f17

Browse files
Merge branch 'master' into release
2 parents f12c063 + 3b86878 commit b617f17

File tree

583 files changed

+9609
-16654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

583 files changed

+9609
-16654
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ This repository contains Aspose.Words Cloud SDK for Ruby source code. This SDK a
1313
* Watermarks and protection
1414
* Full read & write access to Document Object Model, including sections, paragraphs, text, images, tables, headers/footers and many others
1515

16+
## Enhancements in Version 22.10
17+
18+
- Added 'CacheHeaderFooterShapes' property for PdfSaveOptionsData class.
19+
- FileReference structure has been added that allows to determine how the document will be accessed: from the remote storage, or loaded directly in the request.
20+
- The 'AppendDocument' and 'AppendDocumentOnline' methods takes a 'FileReference' instead of an 'href' property.
21+
- Added property 'StartingNumber' for 'PageNumbers' class.
22+
- Added property 'GlobalCultureName' for 'FieldOptions' class.
23+
24+
1625
## Enhancements in Version 22.9
1726

1827
- CompressDocument method now can handle images.
@@ -230,7 +239,7 @@ To use Aspose Words for Cloud Ruby SDK you need to register an account with [Asp
230239
To install this package do the following:
231240
update your Gemfile
232241
```ruby
233-
gem 'aspose_words_cloud', '~> 22.9'
242+
gem 'aspose_words_cloud', '~> 22.10'
234243
```
235244
or install directly
236245
```bash

lib/aspose_words_cloud.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
require_relative 'aspose_words_cloud/configuration'
3131

3232
# Models
33+
require_relative 'aspose_words_cloud/models/file_reference'
3334
require_relative 'aspose_words_cloud/models/response_error'
3435
require_relative 'aspose_words_cloud/models/available_fonts_response'
35-
require_relative 'aspose_words_cloud/models/base_entry'
3636
require_relative 'aspose_words_cloud/models/bmp_save_options_data'
3737
require_relative 'aspose_words_cloud/models/bookmark'
3838
require_relative 'aspose_words_cloud/models/bookmark_data'

lib/aspose_words_cloud/api/words_api.rb

Lines changed: 2543 additions & 12743 deletions
Large diffs are not rendered by default.

lib/aspose_words_cloud/api_client.rb

Lines changed: 65 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def call_api(http_method, path, opts = {})
112112
# @param [String] path URL path (e.g. /account/new)
113113
# @option opts [Hash] :header_params Header parameters
114114
# @option opts [Hash] :query_params Query parameters
115-
# @option opts [Hash] :form_params Query parameters
116115
# @option opts [Object] :body HTTP body (JSON/XML)
117116
# @return [Faraday::Response] A Faraday Response
118117
def build_request(http_method, path, opts = {})
@@ -121,11 +120,9 @@ def build_request(http_method, path, opts = {})
121120

122121
header_params = @default_headers.merge(opts[:header_params] || {})
123122
query_params = opts[:query_params] || {}
124-
form_params = opts[:form_params] || {}
123+
update_params_for_auth! header_params, query_params, ["JWT"]
125124
body = opts[:body] if opts[:body] || nil?
126125

127-
update_params_for_auth! header_params, query_params, opts[:auth_names]
128-
129126
req_opts = {
130127
:method => http_method,
131128
:headers => header_params,
@@ -134,8 +131,6 @@ def build_request(http_method, path, opts = {})
134131
}
135132

136133
if [:post, :patch, :put, :delete].include?(http_method)
137-
req_body = build_request_body(header_params, form_params, opts[:body])
138-
req_opts.update :body => req_body
139134
if @config.debugging
140135
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
141136
end
@@ -404,26 +399,43 @@ def build_request_url(path)
404399
# @param [Hash] form_params Query parameters
405400
# @param [Object] body HTTP body (JSON/XML)
406401
# @return [String] HTTP body data in the form of string
407-
def build_request_body(header_params, form_params, body)
402+
def build_request_body(header_params, form_params, files_references)
408403
# http form
409-
if header_params['Content-Type']['application/x-www-form-urlencoded'] ||
410-
header_params['Content-Type']['multipart/form-data']
404+
files_references.each do |file_reference|
405+
form_params.push({:'Name' => file_reference.reference, :'Data' => file_reference.content, :'MimeType' =>'application/octet-stream'})
406+
end
407+
408+
if form_params.length() == 0
409+
data = nil
410+
elsif form_params.length() == 1
411+
form_param = form_params[0]
412+
value = form_param[:'Data']
413+
case value
414+
when ::File, ::Tempfile
415+
data = File.open(value.path, 'rb') { |f| f.read }
416+
when ::Array, nil, Faraday::ParamPart
417+
data = value
418+
else
419+
data = value.to_s
420+
end
421+
header_params['Content-Type'] = form_param[:'MimeType']
422+
else
411423
data = {}
412-
form_params.each do |key, value|
424+
form_params.each do |form_param|
425+
key = form_param[:'Name']
426+
value = form_param[:'Data']
427+
mimeType = form_param[:'MimeType']
413428
case value
414429
when ::File, ::Tempfile
415-
data[key] = Faraday::FilePart.new(value.path, Marcel::Magic.by_magic(value).to_s, key)
430+
data[key] = Faraday::FilePart.new(value.path, mimeType)
416431
when ::Array, nil, Faraday::ParamPart
417432
data[key] = value
418433
else
419-
data[key] = value.to_s
434+
data[key] = Faraday::ParamPart.new(value.to_s, mimeType)
420435
end
421436
end
422-
elsif body
423-
data = body.is_a?(String) ? body : body.to_json
424-
else
425-
data = nil
426437
end
438+
427439
data
428440
end
429441

@@ -433,26 +445,50 @@ def build_request_body(header_params, form_params, body)
433445
# @param [Hash] form_params Query parameters
434446
# @param [Object] body HTTP body (JSON/XML)
435447
# @return [String] HTTP body data in the form of string
436-
def build_request_body_batch(header_params, form_params, body)
437-
# http form
438-
if header_params['Content-Type']['application/x-www-form-urlencoded'] ||
439-
header_params['Content-Type']['multipart/form-data']
440-
data = {}
441-
form_params.each do |key, value|
448+
def build_request_body_batch(header_params, form_params, files_references)
449+
files_references.each do |file_reference|
450+
form_params.push({:'Name' => file_reference.reference, :'Data' => file_reference.content, :'MimeType' =>'application/octet-stream'})
451+
end
452+
453+
if form_params.length() == 0
454+
data = ''
455+
elsif form_params.length() == 1
456+
form_param = form_params[0]
457+
key = form_param[:'Name']
458+
value = form_param[:'Data']
459+
case value
460+
when ::File, ::Tempfile
461+
data = File.open(value.path, 'rb') { |f| f.read }
462+
when ::Array, nil, Faraday::ParamPart
463+
data = value
464+
else
465+
data = value.to_s
466+
end
467+
header_params['Content-Type'] = form_param[:'MimeType']
468+
else
469+
boundary = SecureRandom.uuid
470+
data = ""
471+
form_params.each do |form_param|
472+
key = form_param[:'Name']
473+
value = form_param[:'Data']
474+
mimeType = form_param[:'MimeType']
475+
data.concat(("--" + boundary + "\r\n").force_encoding('UTF-8'))
476+
data.concat(("Content-Type: " + mimeType + "\r\n").force_encoding('UTF-8'))
477+
data.concat(("Content-Disposition: form-data; name=\"" + key + "\"\r\n\r\n").force_encoding('UTF-8'))
442478
case value
443479
when ::File, ::Tempfile
444-
data[key] = File.open(value.path, 'rb') { |f| f.read }
480+
data.concat(File.open(value.path, 'rb') { |f| f.read })
445481
when ::Array, nil, Faraday::ParamPart
446-
data[key] = value
482+
data.concat(value)
447483
else
448-
data[key] = value.to_s
484+
data.concat(value.to_s)
449485
end
486+
data.concat(("\r\n").force_encoding('UTF-8'))
450487
end
451-
elsif body
452-
data = body.is_a?(String) ? body : body.to_json
453-
else
454-
data = nil
488+
data.concat(("--" + boundary + "--").force_encoding('UTF-8'))
489+
header_params['Content-Type'] = 'multipart/form-data; boundary="' + boundary + '"';
455490
end
491+
456492
data
457493
end
458494

lib/aspose_words_cloud/models/available_fonts_response.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,5 +233,8 @@ def _to_hash(value)
233233
end
234234
end
235235

236+
def collectFilesContent(resultFilesContent)
237+
end
238+
236239
end
237240
end

lib/aspose_words_cloud/models/bmp_save_options_data.rb

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ class BmpSaveOptionsData
4848
# Gets or sets the name of destination file.
4949
attr_accessor :file_name
5050

51-
# Gets or sets value determining which document formats are allowed to be mapped by Aspose.Words.Markup.StructuredDocumentTag.XmlMapping.
52-
# By default only Aspose.Words.LoadFormat.FlatOpc document format is allowed to be mapped.
53-
attr_accessor :flat_opc_xml_mapping_only
54-
5551
# Gets or sets the value determining how ink (InkML) objects are rendered.
5652
attr_accessor :iml_rendering_mode
5753

@@ -175,7 +171,6 @@ def self.attribute_map
175171
:'dml_effects_rendering_mode' => :'DmlEffectsRenderingMode',
176172
:'dml_rendering_mode' => :'DmlRenderingMode',
177173
:'file_name' => :'FileName',
178-
:'flat_opc_xml_mapping_only' => :'FlatOpcXmlMappingOnly',
179174
:'iml_rendering_mode' => :'ImlRenderingMode',
180175
:'update_created_time_property' => :'UpdateCreatedTimeProperty',
181176
:'update_fields' => :'UpdateFields',
@@ -215,7 +210,6 @@ def self.swagger_types
215210
:'dml_effects_rendering_mode' => :'String',
216211
:'dml_rendering_mode' => :'String',
217212
:'file_name' => :'String',
218-
:'flat_opc_xml_mapping_only' => :'BOOLEAN',
219213
:'iml_rendering_mode' => :'String',
220214
:'update_created_time_property' => :'BOOLEAN',
221215
:'update_fields' => :'BOOLEAN',
@@ -280,10 +274,6 @@ def initialize(attributes = {})
280274
self.file_name = attributes[:'FileName']
281275
end
282276

283-
if attributes.key?(:'FlatOpcXmlMappingOnly')
284-
self.flat_opc_xml_mapping_only = attributes[:'FlatOpcXmlMappingOnly']
285-
end
286-
287277
if attributes.key?(:'ImlRenderingMode')
288278
self.iml_rendering_mode = attributes[:'ImlRenderingMode']
289279
end
@@ -543,7 +533,6 @@ def ==(other)
543533
dml_effects_rendering_mode == other.dml_effects_rendering_mode &&
544534
dml_rendering_mode == other.dml_rendering_mode &&
545535
file_name == other.file_name &&
546-
flat_opc_xml_mapping_only == other.flat_opc_xml_mapping_only &&
547536
iml_rendering_mode == other.iml_rendering_mode &&
548537
update_created_time_property == other.update_created_time_property &&
549538
update_fields == other.update_fields &&
@@ -582,7 +571,7 @@ def eql?(other)
582571
# Calculates hash code according to all attributes.
583572
# @return [Fixnum] Hash code
584573
def hash
585-
[allow_embedding_post_script_fonts, custom_time_zone_info_data, dml3_d_effects_rendering_mode, dml_effects_rendering_mode, dml_rendering_mode, file_name, flat_opc_xml_mapping_only, iml_rendering_mode, update_created_time_property, update_fields, update_last_printed_property, update_last_saved_time_property, update_sdt_content, zip_output, color_mode, jpeg_quality, metafile_rendering_options, numeral_format, optimize_output, page_count, page_index, horizontal_resolution, image_brightness, image_color_mode, image_contrast, paper_color, pixel_format, resolution, scale, use_anti_aliasing, use_gdi_emf_renderer, use_high_quality_rendering, vertical_resolution, save_format].hash
574+
[allow_embedding_post_script_fonts, custom_time_zone_info_data, dml3_d_effects_rendering_mode, dml_effects_rendering_mode, dml_rendering_mode, file_name, iml_rendering_mode, update_created_time_property, update_fields, update_last_printed_property, update_last_saved_time_property, update_sdt_content, zip_output, color_mode, jpeg_quality, metafile_rendering_options, numeral_format, optimize_output, page_count, page_index, horizontal_resolution, image_brightness, image_color_mode, image_contrast, paper_color, pixel_format, resolution, scale, use_anti_aliasing, use_gdi_emf_renderer, use_high_quality_rendering, vertical_resolution, save_format].hash
586575
end
587576

588577
# Builds the object from hash
@@ -691,5 +680,8 @@ def _to_hash(value)
691680
end
692681
end
693682

683+
def collectFilesContent(resultFilesContent)
684+
end
685+
694686
end
695687
end

lib/aspose_words_cloud/models/bookmark.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,5 +217,8 @@ def _to_hash(value)
217217
end
218218
end
219219

220+
def collectFilesContent(resultFilesContent)
221+
end
222+
220223
end
221224
end

lib/aspose_words_cloud/models/bookmark_data.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,5 +207,8 @@ def _to_hash(value)
207207
end
208208
end
209209

210+
def collectFilesContent(resultFilesContent)
211+
end
212+
210213
end
211214
end

lib/aspose_words_cloud/models/bookmark_insert.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,5 +227,8 @@ def _to_hash(value)
227227
end
228228
end
229229

230+
def collectFilesContent(resultFilesContent)
231+
end
232+
230233
end
231234
end

lib/aspose_words_cloud/models/bookmark_response.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,5 +207,8 @@ def _to_hash(value)
207207
end
208208
end
209209

210+
def collectFilesContent(resultFilesContent)
211+
end
212+
210213
end
211214
end

0 commit comments

Comments
 (0)