Skip to content

Commit e895dd2

Browse files
SDK regenerated by CI server [ci skip]
1 parent 5999f3b commit e895dd2

File tree

344 files changed

+405
-33
lines changed

Some content is hidden

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

344 files changed

+405
-33
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
- Implemented DeleteOfficeMathObjects operation to delete all office math objects from document.
55
- Parameter ProtectionRequest was removed from the UnprotectDocument operation. Now removing protection from a document does not require a password.
66
- 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.
7+
- Added fields Password and EncryptedPassword to FileReference for documents encrypted by password.
8+
- Removed parameter encryptedPassword2 from CompareDocument method. Please use FileReference password instead.
79

810

911
## [23.11.0] - Aspose Words Cloud for Dart 23.11 Release Notes

lib/src/api_client.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ class ApiClient {
7272
if (rsaPublicKey == null || rsaPublicKey.modulus == null || rsaPublicKey.exponent == null) {
7373
throw ApiException(400, 'Invalid public key response.');
7474
}
75-
exponentString = rsaPublicKey.modulus as String;
76-
modulusString = rsaPublicKey.exponent as String;
75+
exponentString = rsaPublicKey.exponent as String;
76+
modulusString = rsaPublicKey.modulus as String;
7777
}
7878

7979
final modulus = BigInt.parse(hex.encode(base64Decode(modulusString)), radix: 16);

lib/src/models/compare_data.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ class CompareData implements ModelBase {
4848
/// Gets or sets the path to document to compare at the server.
4949
String? _comparingWithDocument;
5050

51-
@Deprecated('This field is deprecated and used only for backward compatibility. Please use FileReference instead.')
51+
@Deprecated("This field is deprecated and used only for backward compatibility. Please use FileReference instead.")
5252
String? get comparingWithDocument => _comparingWithDocument;
53-
@Deprecated('This field is deprecated and used only for backward compatibility. Please use FileReference instead.')
53+
@Deprecated("This field is deprecated and used only for backward compatibility. Please use FileReference instead.")
5454
set comparingWithDocument(String? val) => _comparingWithDocument = val;
5555

5656

lib/src/models/document_entry.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class DocumentEntry extends BaseEntry {
3434
/// Gets or sets document password encrypted on API public key. The default value is null (the document has no password).
3535
String? _encryptedPassword;
3636

37+
@Deprecated("This field is deprecated and used only for backward compatibility. Please use 'Password' or 'EncryptedPassword' from 'FileReference' instead.")
3738
String? get encryptedPassword => _encryptedPassword;
39+
@Deprecated("This field is deprecated and used only for backward compatibility. Please use 'Password' or 'EncryptedPassword' from 'FileReference' instead.")
3840
set encryptedPassword(String? val) => _encryptedPassword = val;
3941

4042

lib/src/models/file_reference.dart

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@
2828
library aspose_words_cloud;
2929

3030
import 'dart:typed_data';
31+
import 'package:aspose_words_cloud/aspose_words_cloud.dart';
32+
import 'package:aspose_words_cloud/src/api_client.dart';
3133
import 'package:uuid/uuid.dart';
32-
import '../../aspose_words_cloud.dart';
3334

3435
class FileReference implements ModelBase {
3536
String? _source;
3637
String? _reference;
3738
ByteData? _content;
39+
String? _password;
40+
String? _encryptedPassword;
3841

3942
/// Gets the file source.
4043
String? get source => _source;
@@ -45,11 +48,11 @@ class FileReference implements ModelBase {
4548
/// Gets the file content
4649
ByteData? get content => _content;
4750

48-
FileReference.fromRemoteFile(String remoteFilePath)
49-
: _source = 'Storage', _content = null, _reference = remoteFilePath;
51+
FileReference.fromRemoteFile(String remoteFilePath, [String? password])
52+
: _source = 'Storage', _content = null, _reference = remoteFilePath, _password = password, _encryptedPassword = null;
5053

51-
FileReference.fromLocalFile(ByteData localFileContent)
52-
: _source = 'Request', _content = localFileContent, _reference = Uuid().v4();
54+
FileReference.fromLocalFile(ByteData localFileContent, [String? password])
55+
: _source = 'Request', _content = localFileContent, _reference = Uuid().v4(), _password = password, _encryptedPassword = null;
5356

5457
@override
5558
void deserialize(Map<String, dynamic>? json) {
@@ -67,6 +70,14 @@ class FileReference implements ModelBase {
6770
_result['Reference'] = _reference;
6871
}
6972

73+
if (_password != null) {
74+
_result['Password'] = _password;
75+
}
76+
77+
if (_encryptedPassword != null) {
78+
_result['EncryptedPassword'] = _encryptedPassword;
79+
}
80+
7081
return _result;
7182
}
7283

@@ -78,4 +89,11 @@ class FileReference implements ModelBase {
7889
@override
7990
void validate() {
8091
}
92+
93+
Future encryptPassword(ApiClient apiClient) async {
94+
if (_password != null) {
95+
_encryptedPassword = await apiClient.encryptPassword(_password!);
96+
_password = null;
97+
}
98+
}
8199
}

lib/src/models/protection_request.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ library aspose_words_cloud;
3030
import '../../aspose_words_cloud.dart';
3131

3232
/// Request on changing of protection.
33-
@Deprecated('ProtectionRequest is deprecated and remains for backwards compatibility only.')
33+
@Deprecated("ProtectionRequest is deprecated and remains for backwards compatibility only.")
3434
class ProtectionRequest extends ProtectionRequestBase {
3535
/// Gets or sets the new password.
3636
String? _newPassword;

lib/src/models/watermark_text.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ library aspose_words_cloud;
3030
import '../../aspose_words_cloud.dart';
3131

3232
/// Class for insert watermark text request building.
33-
@Deprecated('This model will be removed in the future.')
33+
@Deprecated("This model will be removed in the future.")
3434
class WatermarkText implements ModelBase {
3535
/// Gets or sets the watermark rotation angle.
3636
double? _rotationAngle;

lib/src/requests/accept_all_revisions_online_request.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class AcceptAllRevisionsOnlineRequest implements RequestBase {
8787
}
8888

8989
for (final _fileContentPart in _fileContentParts) {
90+
_fileContentPart.encryptPassword(_apiClient);
9091
if (_fileContentPart.source == 'Request') {
9192
_bodyParts.add(ApiRequestPart(_fileContentPart.content!, 'application/octet-stream', name: _fileContentPart.reference));
9293
}

lib/src/requests/accept_all_revisions_request.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class AcceptAllRevisionsRequest implements RequestBase {
9595
}
9696

9797
for (final _fileContentPart in _fileContentParts) {
98+
_fileContentPart.encryptPassword(_apiClient);
9899
if (_fileContentPart.source == 'Request') {
99100
_bodyParts.add(ApiRequestPart(_fileContentPart.content!, 'application/octet-stream', name: _fileContentPart.reference));
100101
}

lib/src/requests/append_document_online_request.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ class AppendDocumentOnlineRequest implements RequestBase {
117117
}
118118

119119
for (final _fileContentPart in _fileContentParts) {
120+
_fileContentPart.encryptPassword(_apiClient);
120121
if (_fileContentPart.source == 'Request') {
121122
_bodyParts.add(ApiRequestPart(_fileContentPart.content!, 'application/octet-stream', name: _fileContentPart.reference));
122123
}

0 commit comments

Comments
 (0)