Skip to content

Commit 83611b0

Browse files
Merge remote-tracking branch 'origin/master' into release
2 parents aad4cad + 6eb3eee commit 83611b0

26 files changed

+811
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [21.12.0] - Aspose Words Cloud for Dart 21.12 Release Notes
2+
3+
- Added 'timeout' parameter to api configuration
4+
15
## [21.11.0] - Aspose Words Cloud for Dart 21.11 Release Notes
26

37
- Support encryption of 'CommonRequest.Password'. Automatic encryption of all passwords sent to the API server as request parameters.

Jenkinsfile

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ properties([
66
[$class: 'StringParameterDefinition', name: 'apiUrl', defaultValue: 'https://api-qa.aspose.cloud', description: 'api url'],
77
[$class: 'BooleanParameterDefinition', name: 'ignoreCiSkip', defaultValue: false, description: 'ignore CI Skip'],
88
[$class: 'StringParameterDefinition', name: 'credentialsId', defaultValue: '6839cbe8-39fa-40c0-86ce-90706f0bae5d', description: 'credentials id'],
9+
[$class: 'BooleanParameterDefinition', name: 'packageTesting', defaultValue: false, description: 'Testing package from repository without local sources. Used for prodhealthcheck'],
910
]
1011
]
1112
])
1213

1314
def needToBuild = false
15+
def packageTesting = false
1416

1517
node('words-linux') {
1618
cleanWs()
@@ -24,6 +26,7 @@ node('words-linux') {
2426
def commitMessage = readFile('gitMessage').trim()
2527
echo commitMessage
2628
needToBuild = params.ignoreCiSkip || !commitMessage.contains('[ci skip]')
29+
packageTesting = params.packageTesting
2730
sh 'git clean -fdx'
2831

2932
if (needToBuild) {
@@ -34,7 +37,31 @@ node('words-linux') {
3437
}
3538
}
3639

37-
if (needToBuild) {
40+
if (packageTesting) {
41+
docker.image('google/dart:2.14').inside {
42+
stage('prepare'){
43+
sh "rm -rf lib"
44+
sh "cp ./pubspec_package_testing.yaml ./pubspec.yaml"
45+
sh "dart pub add aspose_words_cloud"
46+
sh "pub get"
47+
sh "pub global activate junitreport"
48+
}
49+
50+
stage('lint'){
51+
sh "dartanalyzer --fatal-infos --fatal-warnings --options analysis_options.yaml ."
52+
}
53+
54+
stage('tests'){
55+
try {
56+
sh "pub run test test/aspose_words_cloud_tests.dart --concurrency=1 --no-color --reporter expanded --file-reporter json:testReport.json"
57+
} finally {
58+
sh "pub global run junitreport:tojunit --input testReport.json --output testReport.xml"
59+
junit 'testReport.xml'
60+
}
61+
}
62+
}
63+
}
64+
else if (needToBuild) {
3865
docker.image('google/dart:2.14').inside {
3966
stage('prepare'){
4067
sh "pub get"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Add this dependency to your *pubspec.yaml*:
2727

2828
```yaml
2929
dependencies:
30-
aspose_words_cloud: 21.11.0
30+
aspose_words_cloud: 21.12.0
3131
```
3232
3333
## Getting Started

examples/AcceptAllRevisions.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ final clientId = "####-####-####-####-####";
55
final clientSecret = "##################";
66
final config = Configuration(clientId, clientSecret);
77
final wordsApi = WordsApi(config);
8-
final fileName = 'test_doc.docx';
8+
final fileName = 'test_doc.docx';
99

1010
// Upload original document to cloud storage.
1111
final myVar1 = (await File(fileName).readAsBytes()).buffer.asByteData();

examples/AcceptAllRevisionsOnline.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ final clientId = "####-####-####-####-####";
22
final clientSecret = "##################";
33
final config = Configuration(clientId, clientSecret);
44
final wordsApi = WordsApi(config);
5-
final fileName = 'test_doc.docx';
5+
final fileName = 'test_doc.docx';
66

77
// Calls AcceptAllRevisionsOnline method for document in cloud.
88
final requestDocument = (await File(fileName).readAsBytes()).buffer.asByteData();

lib/aspose_words_cloud.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export 'src/models/field_insert.dart';
9494
export 'src/models/field_link.dart';
9595
export 'src/models/field_names.dart';
9696
export 'src/models/field_names_response.dart';
97+
export 'src/models/field_options.dart';
9798
export 'src/models/field_response.dart';
9899
export 'src/models/field_update.dart';
99100
export 'src/models/fields_response.dart';
@@ -134,6 +135,8 @@ export 'src/models/hyperlink_response.dart';
134135
export 'src/models/hyperlinks.dart';
135136
export 'src/models/hyperlinks_response.dart';
136137
export 'src/models/image_save_options_data.dart';
138+
export 'src/models/info_additional_item.dart';
139+
export 'src/models/info_response.dart';
137140
export 'src/models/jpeg_save_options_data.dart';
138141
export 'src/models/json_data_load_options.dart';
139142
export 'src/models/link.dart';
@@ -267,6 +270,7 @@ export 'src/models/text_save_options_data.dart';
267270
export 'src/models/tiff_save_options_data.dart';
268271
export 'src/models/time_zone_info_data.dart';
269272
export 'src/models/txt_save_options_base_data.dart';
273+
export 'src/models/user_information.dart';
270274
export 'src/models/watermark_text.dart';
271275
export 'src/models/word_ml_save_options_data.dart';
272276
export 'src/models/words_api_error_response.dart';
@@ -417,6 +421,7 @@ export 'src/requests/get_header_footer_online_request.dart';
417421
export 'src/requests/get_header_footer_request.dart';
418422
export 'src/requests/get_header_footers_online_request.dart';
419423
export 'src/requests/get_header_footers_request.dart';
424+
export 'src/requests/get_info_request.dart';
420425
export 'src/requests/get_list_online_request.dart';
421426
export 'src/requests/get_list_request.dart';
422427
export 'src/requests/get_lists_online_request.dart';

lib/src/api_client.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class ApiClient {
116116
final url = configuration.baseUrl + '/connect/token';
117117
final data = 'grant_type=client_credentials&client_id=${configuration.clientId}&client_secret=${configuration.clientSecret}';
118118
final headers = {'Content-Type' : 'application/x-www-form-urlencoded'};
119-
final response = await http.post(Uri.parse(url), headers: headers, body: data);
119+
final response = await http.post(Uri.parse(url), headers: headers, body: data).timeout(configuration.timeout);
120120
if (response.statusCode == 400) {
121121
throw ApiException(response.statusCode, 'Invalid server credentials. Please check your ClientSecret and ClientId.');
122122
}
@@ -471,7 +471,7 @@ class ApiClient {
471471

472472
var httpRequest = http.Request(requestData.method, Uri.parse(requestData.url));
473473
httpRequest.headers['x-aspose-client'] = 'dart sdk';
474-
httpRequest.headers['x-aspose-client-version'] = '21.11';
474+
httpRequest.headers['x-aspose-client-version'] = '21.12';
475475
httpRequest.headers['Authorization'] = await _getAuthToken();
476476
if (requestData.headers != null) {
477477
httpRequest.headers.addAll(requestData.headers);
@@ -481,7 +481,7 @@ class ApiClient {
481481
httpRequest.bodyBytes = requestData.body.buffer.asUint8List(requestData.body.offsetInBytes, requestData.body.lengthInBytes);
482482
}
483483

484-
var response = await httpRequest.send();
484+
var response = await httpRequest.send().timeout(configuration.timeout);
485485
var bytes = await response.stream.toBytes();
486486
var responseData = ByteData.view(bytes.buffer);
487487

lib/src/configuration.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ class Configuration {
3232
final String clientSecret;
3333
final String baseUrl;
3434
final bool debugMode;
35+
final Duration timeout;
3536

36-
Configuration(final this.clientId, final this.clientSecret, {final this.baseUrl = 'https://api.aspose.cloud', final this.debugMode = false});
37+
Configuration(final this.clientId, final this.clientSecret, {final this.baseUrl = 'https://api.aspose.cloud', final this.debugMode = false, final this.timeout = const Duration(seconds: 300)});
3738

3839
Configuration.fromJson(final Map<String, dynamic> json)
3940
: clientId = json['ClientId'] as String,
4041
clientSecret = json['ClientSecret'] as String,
4142
baseUrl = json['BaseUrl'] as String ?? 'https://api.aspose.cloud',
42-
debugMode = json['DebugMode'] as bool;
43+
debugMode = json['DebugMode'] as bool,
44+
timeout = Duration(seconds: json['Timeout'] as int ?? 300);
4345

4446
String getApiRootUrl()
4547
{

0 commit comments

Comments
 (0)