Skip to content

Commit a6ff542

Browse files
authored
Release 22.8 (#55)
* Release 22.8
1 parent 527a976 commit a6ff542

31 files changed

+4909
-4989
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ end_of_line = lf
99
insert_final_newline = true
1010
trim_trailing_whitespace = true
1111

12+
[*.{bat,cmd}]
13+
end_of_line = crlf
14+
1215
[*.py]
1316
indent_style = space
1417
indent_size = 4

codegen/Templates/csharp/Configuration.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Aspose.BarCode.Cloud.Sdk.Api
2020
DebugMode = false;
2121
ApiVersion = "{{appVersion}}";
2222
AuthType = AuthType.JWT;
23-
TokenUrl = "https://api.aspose.cloud/connect/token";
23+
TokenUrl = {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#authMethods}}{{#-first}}"{{tokenUrl}}"{{/-first}}{{/authMethods}}{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}};
2424
DefaultHeaders = new Dictionary<string, string>();
2525
}
2626

codegen/Templates/csharp/Project.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ Aspose.Barcode for Cloud allows you to control all aspects of the image and barc
2121
<Version>{{packageVersion}}</Version>
2222
<Authors>asposecloud</Authors>
2323
<AssemblyVersion>{{packageVersion}}.0</AssemblyVersion>
24+
<PackageReadmeFile>README.md</PackageReadmeFile>
2425
</PropertyGroup>
2526

2627
<ItemGroup>
2728
<None Include="LICENSE.txt" Pack="true" PackagePath="" />
2829
<None Include="PackageIcon.png" Pack="true" PackagePath="" />
30+
<None Include="..\README.md" Pack="true" PackagePath=""/>
2931
</ItemGroup>
3032

3133
<ItemGroup>

codegen/Templates/csharp/README.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
[Scan QR](https://products.aspose.app/barcode/scanqr) | [Generate Barcode](https://products.aspose.app/barcode/generate) | [Recognize Barcode](https://products.aspose.app/barcode/recognize)
1414
:---: | :---: | :---:
15-
[![ScanQR](https://products.aspose.app/barcode/scanqr/img/aspose_scanqr-app-48.png)](https://products.aspose.app/barcode/scanqr) | [![Generate](https://products.aspose.app/barcode/generate/img/aspose_generate-app-48.png)](https://products.aspose.app/barcode/generate) | [![Recognize](https://products.aspose.app/barcode/recognize/img/aspose_recognize-app-48.png)](https://products.aspose.app/barcode/recognize)
15+
[![ScanQR](https://raw.githubusercontent.com/aspose-barcode-cloud/aspose-barcode-cloud-codegen/main/img/aspose_scanqr-app-48.png)](https://products.aspose.app/barcode/scanqr) | [![Generate](https://raw.githubusercontent.com/aspose-barcode-cloud/aspose-barcode-cloud-codegen/main/img/aspose_generate-app-48.png)](https://products.aspose.app/barcode/generate) | [![Recognize](https://raw.githubusercontent.com/aspose-barcode-cloud/aspose-barcode-cloud-codegen/main/img/aspose_recognize-app-48.png)](https://products.aspose.app/barcode/recognize)
1616
[**Generate Wi-Fi QR**](https://products.aspose.app/barcode/wifi-qr) | [**Embed Barcode**](https://products.aspose.app/barcode/embed) | [**Scan Barcode**](https://products.aspose.app/barcode/scan)
17-
[![Wi-FiQR](https://products.aspose.app/barcode/embed/img/aspose_wifi-qr-app-48.png)](https://products.aspose.app/barcode/wifi-qr) | [![Embed](https://products.aspose.app/barcode/embed/img/aspose_embed-app-48.png)](https://products.aspose.app/barcode/embed) | [![Scan](https://products.aspose.app/barcode/embed/img/aspose_scan-app-48.png)](https://products.aspose.app/barcode/scan)
17+
[![Wi-FiQR](https://raw.githubusercontent.com/aspose-barcode-cloud/aspose-barcode-cloud-codegen/main/img/aspose_wifi-qr-app-48.png)](https://products.aspose.app/barcode/wifi-qr) | [![Embed](https://raw.githubusercontent.com/aspose-barcode-cloud/aspose-barcode-cloud-codegen/main/img/aspose_embed-app-48.png)](https://products.aspose.app/barcode/embed) | [![Scan](https://raw.githubusercontent.com/aspose-barcode-cloud/aspose-barcode-cloud-codegen/main/img/aspose_scan-app-48.png)](https://products.aspose.app/barcode/scan)
1818

1919
[Aspose.BarCode for Cloud](https://products.aspose.cloud/barcode/) is a REST API for Linear, 2D and postal barcode generation and recognition in the cloud. API recognizes and generates barcode images in a variety of formats. Barcode REST API allows to specify barcode image attributes like image width, height, border style and output image format in order to customize the generation process. Developers can also specify the barcode type and text attributes such as text location and font styles in order to suit the application requirements.
2020

codegen/Templates/java/ApiClient.mustache

Lines changed: 0 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import org.threeten.bp.OffsetDateTime;
2020
import org.threeten.bp.format.DateTimeFormatter;
2121
{{/threetenbp}}
2222

23-
import javax.net.ssl.*;
2423
import java.io.File;
2524
import java.io.IOException;
2625
import java.io.InputStream;
@@ -29,11 +28,6 @@ import java.lang.reflect.Type;
2928
import java.net.URLConnection;
3029
import java.net.URLEncoder;
3130
import java.security.GeneralSecurityException;
32-
import java.security.KeyStore;
33-
import java.security.SecureRandom;
34-
import java.security.cert.Certificate;
35-
import java.security.cert.CertificateFactory;
36-
import java.security.cert.X509Certificate;
3731
import java.text.DateFormat;
3832
{{#java8}}
3933
import java.time.LocalDate;
@@ -62,10 +56,6 @@ public class ApiClient {
6256
private boolean lenientDatetimeFormat;
6357
private int dateLength;
6458
65-
private InputStream sslCaCert;
66-
private boolean verifyingSsl;
67-
private KeyManager[] keyManagers;
68-
6959
private OkHttpClient httpClient;
7060
private JSON json;
7161
@@ -101,8 +91,6 @@ public class ApiClient {
10191
httpClient.interceptors().add(new GzipRequestInterceptor());
10292
{{/useGzipFeature}}
10393

104-
verifyingSsl = true;
105-
10694
json = new JSON();
10795

10896
// Set default User-Agent.
@@ -162,68 +150,6 @@ public class ApiClient {
162150
return this;
163151
}
164152

165-
/**
166-
* True if isVerifyingSsl flag is on
167-
*
168-
* @return True if isVerifySsl flag is on
169-
*/
170-
public boolean isVerifyingSsl() {
171-
return verifyingSsl;
172-
}
173-
174-
/**
175-
* Configure whether to verify certificate and hostname when making https requests.
176-
* Default to true.
177-
* NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks.
178-
*
179-
* @param verifyingSsl True to verify TLS/SSL connection
180-
* @return ApiClient
181-
*/
182-
public ApiClient setVerifyingSsl(boolean verifyingSsl) {
183-
this.verifyingSsl = verifyingSsl;
184-
applySslSettings();
185-
return this;
186-
}
187-
188-
/**
189-
* Get SSL CA cert.
190-
*
191-
* @return Input stream to the SSL CA cert
192-
*/
193-
public InputStream getSslCaCert() {
194-
return sslCaCert;
195-
}
196-
197-
/**
198-
* Configure the CA certificate to be trusted when making https requests.
199-
* Use null to reset to default.
200-
*
201-
* @param sslCaCert input stream for SSL CA cert
202-
* @return ApiClient
203-
*/
204-
public ApiClient setSslCaCert(InputStream sslCaCert) {
205-
this.sslCaCert = sslCaCert;
206-
applySslSettings();
207-
return this;
208-
}
209-
210-
public KeyManager[] getKeyManagers() {
211-
return keyManagers;
212-
}
213-
214-
/**
215-
* Configure client keys to use for authorization in an SSL session.
216-
* Use null to reset to default.
217-
*
218-
* @param managers The KeyManagers to use
219-
* @return ApiClient
220-
*/
221-
public ApiClient setKeyManagers(KeyManager[] managers) {
222-
this.keyManagers = managers;
223-
applySslSettings();
224-
return this;
225-
}
226-
227153
public DateFormat getDateFormat() {
228154
return dateFormat;
229155
}
@@ -1036,70 +962,6 @@ public class ApiClient {
1036962
}
1037963
}
1038964

1039-
/**
1040-
* Apply SSL related settings to httpClient according to the current values of
1041-
* verifyingSsl and sslCaCert.
1042-
*/
1043-
private void applySslSettings() {
1044-
try {
1045-
TrustManager[] trustManagers = null;
1046-
HostnameVerifier hostnameVerifier = null;
1047-
if (!verifyingSsl) {
1048-
TrustManager trustAll = new X509TrustManager() {
1049-
@Override
1050-
public void checkClientTrusted(X509Certificate[] chain, String authType) {}
1051-
@Override
1052-
public void checkServerTrusted(X509Certificate[] chain, String authType) {}
1053-
@Override
1054-
public X509Certificate[] getAcceptedIssuers() { return null; }
1055-
};
1056-
SSLContext sslContext = SSLContext.getInstance("TLS");
1057-
trustManagers = new TrustManager[]{ trustAll };
1058-
hostnameVerifier = new HostnameVerifier() {
1059-
@Override
1060-
public boolean verify(String hostname, SSLSession session) { return true; }
1061-
};
1062-
} else if (sslCaCert != null) {
1063-
char[] password = null; // Any password will work.
1064-
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
1065-
Collection<? extends Certificate> certificates = certificateFactory.generateCertificates(sslCaCert);
1066-
if (certificates.isEmpty()) {
1067-
throw new IllegalArgumentException("expected non-empty set of trusted certificates");
1068-
}
1069-
KeyStore caKeyStore = newEmptyKeyStore(password);
1070-
int index = 0;
1071-
for (Certificate certificate : certificates) {
1072-
String certificateAlias = "ca" + index++;
1073-
caKeyStore.setCertificateEntry(certificateAlias, certificate);
1074-
}
1075-
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
1076-
trustManagerFactory.init(caKeyStore);
1077-
trustManagers = trustManagerFactory.getTrustManagers();
1078-
}
1079-
1080-
if (keyManagers != null || trustManagers != null) {
1081-
SSLContext sslContext = SSLContext.getInstance("TLS");
1082-
sslContext.init(keyManagers, trustManagers, new SecureRandom());
1083-
httpClient.setSslSocketFactory(sslContext.getSocketFactory());
1084-
} else {
1085-
httpClient.setSslSocketFactory(null);
1086-
}
1087-
httpClient.setHostnameVerifier(hostnameVerifier);
1088-
} catch (GeneralSecurityException e) {
1089-
throw new RuntimeException(e);
1090-
}
1091-
}
1092-
1093-
private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException {
1094-
try {
1095-
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
1096-
keyStore.load(null, password);
1097-
return keyStore;
1098-
} catch (IOException e) {
1099-
throw new AssertionError(e);
1100-
}
1101-
}
1102-
1103965
/**
1104966
* Request OAuth token
1105967
*

codegen/Templates/nodejs/docs/tsconfig.mustache

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,26 @@ npm install aspose-barcode-cloud-node --save
3636

3737
### Sample usage
3838

39-
The examples below show how your application have to generate PDF417 barcode and save it on local storage:
39+
The examples below show how your application have to generate QR code and save it on local storage:
4040

4141
```js
4242
const fs = require('fs');
4343
const Barcode = require('aspose-barcode-cloud-node');
4444

4545
const config = new Barcode.Configuration(
4646
'Client Id from https://dashboard.aspose.cloud/applications',
47-
'Client Secret from https://dashboard.aspose.cloud/applications'
47+
'Client Secret from https://dashboard.aspose.cloud/applications',
48+
null,
49+
process.env['TEST_CONFIGURATION_ACCESS_TOKEN']
4850
);
4951

5052
async function generateBarcode(api) {
5153
const request = new Barcode.GetBarcodeGenerateRequest(
52-
Barcode.EncodeBarcodeType.Pdf417,
54+
Barcode.EncodeBarcodeType.QR,
5355
'Aspose.BarCode for Cloud Sample');
5456
const oneBarcode = await api.getBarcodeGenerate(request);
5557
56-
const fileName = 'Pdf417.png'
58+
const fileName = 'QR.png'
5759
fs.writeFileSync(fileName, oneBarcode.body);
5860
5961
return fileName;
@@ -62,7 +64,9 @@ async function generateBarcode(api) {
6264
async function recognizeBarcode(api, fileName) {
6365
const request = new Barcode.PostBarcodeRecognizeFromUrlOrContentRequest();
6466
request.image = fs.readFileSync(fileName);
67+
request.type = Barcode.DecodeBarcodeType.QR;
6568
request.preset = Barcode.PresetType.HighPerformance;
69+
request.fastScanOnly = true;
6670
6771
const result = await api.postBarcodeRecognizeFromUrlOrContent(request);
6872

codegen/Templates/nodejs/package.mustache

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,20 @@
129129
"dist"
130130
],
131131
"engines": {
132-
"node": ">=10"
132+
"node": ">=12"
133+
},
134+
"dependencies": {
135+
"@types/request": "^2.48.8",
136+
"request": "^2.88.2"
133137
},
134138
"scripts": {
135139
"test": "tsdx test",
136140
"cover": "tsdx test --collect-coverage",
137141
"lint": "tsc --strict",
138142
"format": "tsdx lint --fix",
139143
"prepare": "tsdx build --target=node",
140-
"check-updates": "ncu -u"
144+
"check-updates": "ncu -u --enginesNode"
141145
},
142-
"peerDependencies": {},
143146
"prettier": {
144147
"printWidth": 120,
145148
"semi": true,
@@ -149,16 +152,12 @@
149152
},
150153
"devDependencies": {
151154
"@types/uuid": "^8.3.4",
152-
"npm-check-updates": "^16.0.1",
155+
"npm-check-updates": "^12.5.12",
153156
"tsdx": "^0.14.1",
154157
"tslib": "^2.4.0",
155158
"typescript": "^4.7.4",
156159
"uuid": "^8.3.2"
157160
},
158-
"dependencies": {
159-
"@types/request": "^2.48.8",
160-
"request": "^2.88.2"
161-
},
162161
"bugs": {
163162
"url": "https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-node/issues"
164163
},

codegen/Templates/python/README.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This repository contains Aspose.BarCode Cloud SDK for Python source code. This S
2222
Supported Python versions:
2323

2424
- Python 2.7
25-
- Python 3.4+
25+
- Python 3.5+
2626

2727
To use these SDKs, you will need Client Id and Client Secret which can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/applications) (free registration in Aspose Cloud is required for this).
2828

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
{{^asyncio}}
2-
coverage>=4.0.3
3-
{{/asyncio}}
4-
{{#asyncio}}
5-
pytest>=3.3.1
6-
pytest-cov>=2.5.1
7-
{{/asyncio}}
1+
pytest
2+
pytest-cov
83
mock; python_version < "3"
94
black; python_version > "3.7"
Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
[tox]
2-
{{^asyncio}}
32
envlist = py27, py3
4-
{{/asyncio}}
5-
{{#asyncio}}
6-
envlist = py3
7-
{{/asyncio}}
83

94
[testenv]
105
passenv = TEST_CONFIGURATION_ACCESS_TOKEN
6+
skip_install=True
7+
whitelist_externals = make
118
deps=-r{toxinidir}/requirements.txt
129
-r{toxinidir}/test-requirements.txt
1310

1411
commands=
15-
{{^asyncio}}
16-
python -m unittest discover -v
17-
{{/asyncio}}
18-
{{#asyncio}}
19-
pytest -v --cov petstore_api
20-
{{/asyncio}}
21-
python example.py
12+
make test
13+
python -Werror example.py

0 commit comments

Comments
 (0)