Skip to content

Commit 7bb7dd1

Browse files
Merge remote-tracking branch 'origin/master' into release
2 parents 749dc29 + 2e868a9 commit 7bb7dd1

13 files changed

+288
-18
lines changed

AsposeWordsCloud.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'AsposeWordsCloud'
3-
s.version = '21.6'
3+
s.version = '21.7'
44
s.summary = 'Aspose Words for Cloud.'
55
s.homepage = 'https://github.com/aspose-words-cloud/aspose-words-cloud-swift.git'
66
s.license = { :type => 'MIT', :file => 'LICENSE' }

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ This repository contains Aspose.Words Cloud SDK for Swift source code. This SDK
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 21.7
17+
18+
- ImlRenderingMode option introduced witch is used to determine how ink (InkML) objects are rendered
19+
- MaxCharactersPerLine option introduced which is used to specify the maximum number of characters per one line
20+
- Added new API method to get a RSA public key to encrypt document passwords
21+
- Added encryptedPassword common query option to pass an encrypted document password
22+
23+
1624
## Enhancements in Version 21.6
1725

1826
- Implemented beta version of CompareDocumentOnline feature with both document sending in request
@@ -142,7 +150,7 @@ Add link to this repository as dependency to your Package.swift:
142150

143151
dependencies: [
144152
// Dependencies declare other packages that this package depends on.
145-
.package(url: "https://github.com/aspose-words-cloud/aspose-words-cloud-swift", from: "21.6"),
153+
.package(url: "https://github.com/aspose-words-cloud/aspose-words-cloud-swift", from: "21.7"),
146154
],
147155
targets: [
148156
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
@@ -160,7 +168,7 @@ targets: [
160168
Add link to git repository as dependency to your Podfile:
161169

162170
```ruby
163-
pod 'AsposeWordsCloud', :git => 'https://github.com/aspose-words-cloud/aspose-words-cloud-swift.git', :tag => '21.6'
171+
pod 'AsposeWordsCloud', :git => 'https://github.com/aspose-words-cloud/aspose-words-cloud-swift.git', :tag => '21.7'
164172
```
165173

166174
## Getting Started

Sources/AsposeWordsCloud/Api/Configuration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,6 @@ public class Configuration : Codable {
117117

118118
// Returns SDK version for using in statistics headers
119119
public func getSdkVersion() -> String {
120-
return "21.6";
120+
return "21.7";
121121
}
122122
}

Sources/AsposeWordsCloud/Api/WordsAPI.swift

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6599,6 +6599,52 @@ public class WordsAPI {
65996599
return responseObject!;
66006600
}
66016601

6602+
// Async representation of getPublicKey method
6603+
// Get assymetric public key.
6604+
public func getPublicKey(request : GetPublicKeyRequest, callback : @escaping (_ response : PublicKeyResponse?, _ error : Error?) -> ()) {
6605+
do {
6606+
apiInvoker.invoke(
6607+
apiRequestData: try request.createApiRequestData(configuration: self.configuration),
6608+
callback: { response, error in
6609+
if (error != nil) {
6610+
callback(nil, error);
6611+
}
6612+
else {
6613+
do {
6614+
callback(try request.deserializeResponse(data: response!) as? PublicKeyResponse, nil);
6615+
}
6616+
catch let deserializeError {
6617+
callback(nil, deserializeError);
6618+
}
6619+
}
6620+
}
6621+
);
6622+
}
6623+
catch let error {
6624+
callback(nil, error);
6625+
}
6626+
}
6627+
6628+
// Sync representation of getPublicKey method
6629+
// Get assymetric public key.
6630+
public func getPublicKey(request : GetPublicKeyRequest) throws -> PublicKeyResponse {
6631+
let semaphore = DispatchSemaphore(value: 0);
6632+
var responseObject : PublicKeyResponse? = nil;
6633+
var responseError : Error? = nil;
6634+
self.getPublicKey(request : request, callback: { response, error in
6635+
responseObject = response;
6636+
responseError = error;
6637+
semaphore.signal();
6638+
});
6639+
6640+
_ = semaphore.wait();
6641+
6642+
if (responseError != nil) {
6643+
throw responseError!;
6644+
}
6645+
return responseObject!;
6646+
}
6647+
66026648
// Async representation of getRangeText method
66036649
// Reads range text from the document.
66046650
public func getRangeText(request : GetRangeTextRequest, callback : @escaping (_ response : RangeTextResponse?, _ error : Error?) -> ()) {
@@ -10918,7 +10964,7 @@ public class WordsAPI {
1091810964
}
1091910965

1092010966
// Async representation of saveAsOnline method
10921-
// Converts a document in cloud storage to the specified format.
10967+
// Converts a document to the specified format.
1092210968
public func saveAsOnline(request : SaveAsOnlineRequest, callback : @escaping (_ response : SaveAsOnlineResponse?, _ error : Error?) -> ()) {
1092310969
do {
1092410970
apiInvoker.invoke(
@@ -10944,7 +10990,7 @@ public class WordsAPI {
1094410990
}
1094510991

1094610992
// Sync representation of saveAsOnline method
10947-
// Converts a document in cloud storage to the specified format.
10993+
// Converts a document to the specified format.
1094810994
public func saveAsOnline(request : SaveAsOnlineRequest) throws -> SaveAsOnlineResponse {
1094910995
let semaphore = DispatchSemaphore(value: 0);
1095010996
var responseObject : SaveAsOnlineResponse? = nil;
@@ -11102,7 +11148,7 @@ public class WordsAPI {
1110211148
}
1110311149

1110411150
// Async representation of saveAsTiffOnline method
11105-
// Converts a document in cloud storage to TIFF format using detailed conversion settings.
11151+
// Converts a document to TIFF format using detailed conversion settings.
1110611152
public func saveAsTiffOnline(request : SaveAsTiffOnlineRequest, callback : @escaping (_ response : SaveAsTiffOnlineResponse?, _ error : Error?) -> ()) {
1110711153
do {
1110811154
apiInvoker.invoke(
@@ -11128,7 +11174,7 @@ public class WordsAPI {
1112811174
}
1112911175

1113011176
// Sync representation of saveAsTiffOnline method
11131-
// Converts a document in cloud storage to TIFF format using detailed conversion settings.
11177+
// Converts a document to TIFF format using detailed conversion settings.
1113211178
public func saveAsTiffOnline(request : SaveAsTiffOnlineRequest) throws -> SaveAsTiffOnlineResponse {
1113311179
let semaphore = DispatchSemaphore(value: 0);
1113411180
var responseObject : SaveAsTiffOnlineResponse? = nil;
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="PublicKeyResponse.swift">
4+
* Copyright (c) 2021 Aspose.Words for Cloud
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+
import Foundation
29+
30+
// REST response for RSA public key info.
31+
public class PublicKeyResponse : WordsResponse {
32+
// Field of exponent. REST response for RSA public key info.
33+
private var exponent : String?;
34+
35+
// Field of modulus. REST response for RSA public key info.
36+
private var modulus : String?;
37+
38+
private enum CodingKeys: String, CodingKey {
39+
case exponent = "Exponent";
40+
case modulus = "Modulus";
41+
case invalidCodingKey;
42+
}
43+
44+
public override init() {
45+
super.init();
46+
}
47+
48+
public required init(from decoder: Decoder) throws {
49+
try super.init(from: decoder);
50+
let container = try decoder.container(keyedBy: CodingKeys.self);
51+
self.exponent = try container.decodeIfPresent(String.self, forKey: .exponent);
52+
self.modulus = try container.decodeIfPresent(String.self, forKey: .modulus);
53+
}
54+
55+
public override func encode(to encoder: Encoder) throws {
56+
try super.encode(to: encoder);
57+
var container = encoder.container(keyedBy: CodingKeys.self);
58+
if (self.exponent != nil) {
59+
try container.encode(self.exponent, forKey: .exponent);
60+
}
61+
if (self.modulus != nil) {
62+
try container.encode(self.modulus, forKey: .modulus);
63+
}
64+
}
65+
66+
// Sets exponent. Gets or sets RSA key exponent as Base64 string.
67+
public func setExponent(exponent : String?) {
68+
self.exponent = exponent;
69+
}
70+
71+
// Gets exponent. Gets or sets RSA key exponent as Base64 string.
72+
public func getExponent() -> String? {
73+
return self.exponent;
74+
}
75+
76+
// Sets modulus. Gets or sets RSA key modulus as Base64 string.
77+
public func setModulus(modulus : String?) {
78+
self.modulus = modulus;
79+
}
80+
81+
// Gets modulus. Gets or sets RSA key modulus as Base64 string.
82+
public func getModulus() -> String? {
83+
return self.modulus;
84+
}
85+
}

Sources/AsposeWordsCloud/Model/Requests/AppendDocumentOnlineRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class AppendDocumentOnlineRequest : WordsApiRequest {
5959
self.revisionDateTime = revisionDateTime;
6060
}
6161

62-
// The document.
62+
// Original document.
6363
public func getDocument() -> InputStream {
6464
return self.document;
6565
}

Sources/AsposeWordsCloud/Model/Requests/GetDocumentFieldNamesOnlineRequest.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,30 @@ import Foundation
2929

3030
// Request model for getDocumentFieldNamesOnline operation.
3131
public class GetDocumentFieldNamesOnlineRequest : WordsApiRequest {
32-
private let document : InputStream;
32+
private let template : InputStream;
3333
private let loadEncoding : String?;
3434
private let password : String?;
3535
private let useNonMergeFields : Bool?;
3636

3737
private enum CodingKeys: String, CodingKey {
38-
case document;
38+
case template;
3939
case loadEncoding;
4040
case password;
4141
case useNonMergeFields;
4242
case invalidCodingKey;
4343
}
4444

4545
// Initializes a new instance of the GetDocumentFieldNamesOnlineRequest class.
46-
public init(document : InputStream, loadEncoding : String? = nil, password : String? = nil, useNonMergeFields : Bool? = nil) {
47-
self.document = document;
46+
public init(template : InputStream, loadEncoding : String? = nil, password : String? = nil, useNonMergeFields : Bool? = nil) {
47+
self.template = template;
4848
self.loadEncoding = loadEncoding;
4949
self.password = password;
5050
self.useNonMergeFields = useNonMergeFields;
5151
}
5252

53-
// The document.
54-
public func getDocument() -> InputStream {
55-
return self.document;
53+
// The template document.
54+
public func getTemplate() -> InputStream {
55+
return self.template;
5656
}
5757

5858
// Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
@@ -94,7 +94,7 @@ public class GetDocumentFieldNamesOnlineRequest : WordsApiRequest {
9494
urlBuilder.queryItems = queryItems;
9595
}
9696
var formParams : [RequestFormParam] = [];
97-
formParams.append(RequestFormParam(name: "document", body: try ObjectSerializer.serializeFile(value: self.getDocument()), contentType: "application/octet-stream"));
97+
formParams.append(RequestFormParam(name: "template", body: try ObjectSerializer.serializeFile(value: self.getTemplate()), contentType: "application/octet-stream"));
9898

9999

100100
var result = WordsApiRequestData(url: urlBuilder.url!, method: "PUT");
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="GetPublicKeyRequest.swift">
4+
* Copyright (c) 2021 Aspose.Words for Cloud
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+
import Foundation
29+
30+
// Request model for getPublicKey operation.
31+
public class GetPublicKeyRequest : WordsApiRequest {
32+
// Creates the api request data
33+
public func createApiRequestData(configuration : Configuration) throws -> WordsApiRequestData {
34+
var rawPath = "/words/encryption/publickey";
35+
rawPath = rawPath.replacingOccurrences(of: "//", with: "/");
36+
37+
let urlPath = (try configuration.getApiRootUrl()).appendingPathComponent(rawPath);
38+
39+
let result = WordsApiRequestData(url: urlPath, method: "GET");
40+
return result;
41+
}
42+
43+
// Deserialize response of this request
44+
public func deserializeResponse(data : Data) throws -> Any? {
45+
return try ObjectSerializer.deserialize(type: PublicKeyResponse.self, from: data);
46+
}
47+
}

Sources/AsposeWordsCloud/Model/SaveOptionsData.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public class SaveOptionsData : Codable, WordsApiModel {
5757
// Field of fileName. base container class for save options data.
5858
private var fileName : String?;
5959

60+
// Field of imlRenderingMode. base container class for save options data.
61+
private var imlRenderingMode : String?;
62+
6063
// Field of saveFormat. base container class for save options data.
6164
private var saveFormat : String?;
6265

@@ -85,6 +88,7 @@ public class SaveOptionsData : Codable, WordsApiModel {
8588
case dmlEffectsRenderingMode = "DmlEffectsRenderingMode";
8689
case dmlRenderingMode = "DmlRenderingMode";
8790
case fileName = "FileName";
91+
case imlRenderingMode = "ImlRenderingMode";
8892
case saveFormat = "SaveFormat";
8993
case updateCreatedTimeProperty = "UpdateCreatedTimeProperty";
9094
case updateFields = "UpdateFields";
@@ -106,6 +110,7 @@ public class SaveOptionsData : Codable, WordsApiModel {
106110
self.dmlEffectsRenderingMode = try container.decodeIfPresent(String.self, forKey: .dmlEffectsRenderingMode);
107111
self.dmlRenderingMode = try container.decodeIfPresent(String.self, forKey: .dmlRenderingMode);
108112
self.fileName = try container.decodeIfPresent(String.self, forKey: .fileName);
113+
self.imlRenderingMode = try container.decodeIfPresent(String.self, forKey: .imlRenderingMode);
109114
self.saveFormat = try container.decodeIfPresent(String.self, forKey: .saveFormat);
110115
self.updateCreatedTimeProperty = try container.decodeIfPresent(Bool.self, forKey: .updateCreatedTimeProperty);
111116
self.updateFields = try container.decodeIfPresent(Bool.self, forKey: .updateFields);
@@ -135,6 +140,9 @@ public class SaveOptionsData : Codable, WordsApiModel {
135140
if (self.fileName != nil) {
136141
try container.encode(self.fileName, forKey: .fileName);
137142
}
143+
if (self.imlRenderingMode != nil) {
144+
try container.encode(self.imlRenderingMode, forKey: .imlRenderingMode);
145+
}
138146
if (self.saveFormat != nil) {
139147
try container.encode(self.saveFormat, forKey: .saveFormat);
140148
}
@@ -218,6 +226,16 @@ public class SaveOptionsData : Codable, WordsApiModel {
218226
return self.fileName;
219227
}
220228

229+
// Sets imlRenderingMode. Gets or sets the value determining how ink (InkML) objects are rendered.
230+
public func setImlRenderingMode(imlRenderingMode : String?) {
231+
self.imlRenderingMode = imlRenderingMode;
232+
}
233+
234+
// Gets imlRenderingMode. Gets or sets the value determining how ink (InkML) objects are rendered.
235+
public func getImlRenderingMode() -> String? {
236+
return self.imlRenderingMode;
237+
}
238+
221239
// Sets saveFormat. Gets or sets the format of save.
222240
public func setSaveFormat(saveFormat : String?) {
223241
self.saveFormat = saveFormat;

0 commit comments

Comments
 (0)