Skip to content

Commit 2b881c2

Browse files
Merge branch 'master' into release
2 parents 415c805 + 3c17759 commit 2b881c2

File tree

721 files changed

+1437
-928
lines changed

Some content is hidden

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

721 files changed

+1437
-928
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,23 @@ 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 24.1
17+
18+
- Added support for InsertAfterNode in the insert API without NodePath.
19+
- Added support for inserting nodes (runs/rows/cells/bookmarks) without NodePath.
20+
- Added support for transparency in the Watermark API.
21+
- Added support for password and encryptedPassword fields in FileReference.
22+
- Fixed missing href value in document responses.
23+
24+
1625
## Enhancements in Version 23.12
1726

1827
- Properties Name, Text, StartRange, EndRange marked as required for InsertBookmark operation.
1928
- Implemented DeleteOfficeMathObjects operation to delete all office math objects from document.
2029
- Parameter ProtectionRequest was removed from the UnprotectDocument operation. Now removing protection from a document does not require a password.
2130
- Model ProtectionRequest marked as deprecated, please use ProtectionRequestV2 instead for perform ProtectDocument operation. To change the password or protection type of protected document, the old password is no required.
31+
- Added fields Password and EncryptedPassword to FileReference for documents encrypted by password.
32+
- Removed parameter encryptedPassword2 from CompareDocument method. Please use FileReference password instead.
2233
- Rename aspose-client header.
2334

2435
## Enhancements in Version 23.11
@@ -305,7 +316,7 @@ To use Aspose Words for Cloud Ruby SDK you need to register an account with [Asp
305316
To install this package do the following:
306317
update your Gemfile
307318
```ruby
308-
gem 'aspose_words_cloud', '~> 23.12'
319+
gem 'aspose_words_cloud', '~> 24.1'
309320
```
310321
or install directly
311322
```bash

lib/aspose_words_cloud.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------------
22
# <copyright company="Aspose" file="aspose_words_cloud.rb">
3-
# Copyright (c) 2023 Aspose.Words for Cloud
3+
# Copyright (c) 2024 Aspose.Words for Cloud
44
# </copyright>
55
# <summary>
66
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -166,7 +166,6 @@
166166
require_relative 'aspose_words_cloud/models/metafile_rendering_options_data'
167167
require_relative 'aspose_words_cloud/models/mhtml_save_options_data'
168168
require_relative 'aspose_words_cloud/models/modification_operation_result'
169-
require_relative 'aspose_words_cloud/models/new_document_position'
170169
require_relative 'aspose_words_cloud/models/node_link'
171170
require_relative 'aspose_words_cloud/models/odt_save_options_data'
172171
require_relative 'aspose_words_cloud/models/office_math_link'
@@ -197,6 +196,9 @@
197196
require_relative 'aspose_words_cloud/models/pdf_permissions'
198197
require_relative 'aspose_words_cloud/models/pdf_save_options_data'
199198
require_relative 'aspose_words_cloud/models/png_save_options_data'
199+
require_relative 'aspose_words_cloud/models/position_after_node'
200+
require_relative 'aspose_words_cloud/models/position_before_node'
201+
require_relative 'aspose_words_cloud/models/position_inside_node'
200202
require_relative 'aspose_words_cloud/models/preferred_width'
201203
require_relative 'aspose_words_cloud/models/protection_data'
202204
require_relative 'aspose_words_cloud/models/protection_data_response'

lib/aspose_words_cloud/api/words_api.rb

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------------
22
# <copyright company="Aspose" file="words_api.rb">
3-
# Copyright (c) 2023 Aspose.Words for Cloud
3+
# Copyright (c) 2024 Aspose.Words for Cloud
44
# </copyright>
55
# <summary>
66
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -36,6 +36,7 @@ class WordsApi
3636

3737
def initialize(api_client = ApiClient.default)
3838
@api_client = api_client
39+
@api_client.config.encryptor = self
3940
@rsa_key = nil
4041
require_all '../models/requests'
4142
require_all '../models/responses'
@@ -14383,14 +14384,13 @@ def encrypt(data)
1438314384
modulus = @api_client.config.modulus
1438414385
exponent = @api_client.config.exponent
1438514386

14386-
if modulus.to_s.empty || exponent.to_s.empty
14387-
data = self.get_public_key GetPublicKeyRequest.new
14388-
modulus = data.modulus
14389-
exponent = data.exponent
14387+
if (modulus == nil || modulus.to_s.empty?) || (exponent == nil || exponent.to_s.empty?)
14388+
response = self.get_public_key GetPublicKeyRequest.new
14389+
modulus = response.modulus
14390+
exponent = response.exponent
1439014391
end
1439114392

14392-
@rsa_key = OpenSSL::PKey::RSA.new
14393-
@rsa_key.set_key(base64_to_long(modulus), base64_to_long(exponent), nil)
14393+
@rsa_key = rsa = create_rsa_key(modulus, exponent)
1439414394
end
1439514395

1439614396
Base64.encode64(@rsa_key.public_encrypt(data.to_s.force_encoding("utf-8")))
@@ -14423,15 +14423,24 @@ def encrypt(data)
1442314423
end
1442414424
end
1442514425

14426+
private def create_rsa_key(n, e)
14427+
data_sequence = OpenSSL::ASN1::Sequence([
14428+
OpenSSL::ASN1::Integer(base64_to_long(n)),
14429+
OpenSSL::ASN1::Integer(base64_to_long(e))
14430+
])
14431+
asn1 = OpenSSL::ASN1::Sequence(data_sequence)
14432+
OpenSSL::PKey::RSA.new(asn1.to_der)
14433+
end
14434+
1442614435
private def base64_to_long(data)
14427-
decoded_with_padding = Base64.urlsafe_decode64(data) + Base64.decode64('==')
14428-
decoded_with_padding.to_s.unpack('C*').map do |byte|
14429-
to_hex(byte)
14436+
decoded_with_padding = Base64.urlsafe_decode64(data) + Base64.decode64("==")
14437+
decoded_with_padding.to_s.unpack("C*").map do |byte|
14438+
byte_to_hex(byte)
1443014439
end.join.to_i(16)
1443114440
end
1443214441

14433-
private def to_hex(int)
14434-
int < 16 ? '0' + int.to_s(16) : int.to_s(16)
14442+
private def byte_to_hex(int)
14443+
int < 16 ? "0" + int.to_s(16) : int.to_s(16)
1443514444
end
1443614445
end
1443714446
end

lib/aspose_words_cloud/api_client.rb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------------
22
# <copyright company="Aspose" file="api_client.rb">
3-
# Copyright (c) 2023 Aspose.Words for Cloud
3+
# Copyright (c) 2024 Aspose.Words for Cloud
44
# </copyright>
55
# <summary>
66
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -406,7 +406,13 @@ def build_request_url(path)
406406
def build_request_body(header_params, form_params, files_references)
407407
# http form
408408
files_references.each do |file_reference|
409-
form_params.push({:'Name' => file_reference.reference, :'Data' => file_reference.content, :'MimeType' =>'application/octet-stream'})
409+
if !file_reference.password.nil?
410+
file_reference.encryptedPassword = self.config.encryptor.encrypt(file_reference.password)
411+
file_reference.password = nil
412+
end
413+
if file_reference.source == 'Request'
414+
form_params.push({:'Name' => file_reference.reference, :'Data' => file_reference.content, :'MimeType' =>'application/octet-stream'})
415+
end
410416
end
411417

412418
if form_params.length() == 0
@@ -451,7 +457,13 @@ def build_request_body(header_params, form_params, files_references)
451457
# @return [String] HTTP body data in the form of string
452458
def build_request_body_batch(header_params, form_params, files_references)
453459
files_references.each do |file_reference|
454-
form_params.push({:'Name' => file_reference.reference, :'Data' => file_reference.content, :'MimeType' =>'application/octet-stream'})
460+
if !file_reference.password.nil?
461+
file_reference.encryptedPassword = self.config.encryptor.encrypt(file_reference.password)
462+
file_reference.password = nil
463+
end
464+
if file_reference.source == 'Request'
465+
form_params.push({:'Name' => file_reference.reference, :'Data' => file_reference.content, :'MimeType' =>'application/octet-stream'})
466+
end
455467
end
456468

457469
if form_params.length() == 0

lib/aspose_words_cloud/api_error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------------
22
# <copyright company="Aspose" file="api_error.rb">
3-
# Copyright (c) 2023 Aspose.Words for Cloud
3+
# Copyright (c) 2024 Aspose.Words for Cloud
44
# </copyright>
55
# <summary>
66
# Permission is hereby granted, free of charge, to any person obtaining a copy

lib/aspose_words_cloud/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------------
22
# <copyright company="Aspose" file="configuration.rb">
3-
# Copyright (c) 2023 Aspose.Words for Cloud
3+
# Copyright (c) 2024 Aspose.Words for Cloud
44
# </copyright>
55
# <summary>
66
# Permission is hereby granted, free of charge, to any person obtaining a copy

lib/aspose_words_cloud/models/available_fonts_response.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------------
22
# <copyright company="Aspose" file="available_fonts_response.rb">
3-
# Copyright (c) 2023 Aspose.Words for Cloud
3+
# Copyright (c) 2024 Aspose.Words for Cloud
44
# </copyright>
55
# <summary>
66
# Permission is hereby granted, free of charge, to any person obtaining a copy

lib/aspose_words_cloud/models/bmp_save_options_data.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------------
22
# <copyright company="Aspose" file="bmp_save_options_data.rb">
3-
# Copyright (c) 2023 Aspose.Words for Cloud
3+
# Copyright (c) 2024 Aspose.Words for Cloud
44
# </copyright>
55
# <summary>
66
# Permission is hereby granted, free of charge, to any person obtaining a copy

lib/aspose_words_cloud/models/bookmark.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------------
22
# <copyright company="Aspose" file="bookmark.rb">
3-
# Copyright (c) 2023 Aspose.Words for Cloud
3+
# Copyright (c) 2024 Aspose.Words for Cloud
44
# </copyright>
55
# <summary>
66
# Permission is hereby granted, free of charge, to any person obtaining a copy

lib/aspose_words_cloud/models/bookmark_data.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------------
22
# <copyright company="Aspose" file="bookmark_data.rb">
3-
# Copyright (c) 2023 Aspose.Words for Cloud
3+
# Copyright (c) 2024 Aspose.Words for Cloud
44
# </copyright>
55
# <summary>
66
# Permission is hereby granted, free of charge, to any person obtaining a copy

0 commit comments

Comments
 (0)