Skip to content

Commit 28704b5

Browse files
authored
Updated to version 20.11 (#10)
Documentation and code samples updated
1 parent f8d4f68 commit 28704b5

10 files changed

Lines changed: 38 additions & 33 deletions

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ format:
66
./scripts/docs_format.sh
77
npm run format
88

9+
.PHONY: clean
10+
clean:
11+
npm run clean
12+
913
.PHONY: build
10-
build:
14+
build: clean
1115
npm run build
1216

1317
.PHONY: test
@@ -27,6 +31,7 @@ update_modules:
2731
npm run check-updates
2832
npm update
2933
npm outdated
34+
npm run prepare
3035

3136
.PHONY: check_git
3237
check_git:

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Aspose.BarCode Cloud SDK for Node.js
22

33
+ API version: 3.0
4-
+ Package version: 20.10.0
4+
+ Package version: 20.11.0
55

66
Aspose.BarCode for Cloud 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.
77

88
This repository contains Aspose.BarCode Cloud SDK for Node.js source code.
99

10-
To use these SDKs, you will need App SID and App Key which can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/#/apps) (free registration in Aspose Cloud is required for this).
10+
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).
1111

1212
## How to use the SDK
1313

@@ -30,8 +30,8 @@ const fs = require('fs');
3030
const Barcode = require('aspose-barcode-cloud-node');
3131

3232
const config = new Barcode.Configuration(
33-
'App SID from https://dashboard.aspose.cloud/#/apps',
34-
'App Key from https://dashboard.aspose.cloud/#/apps'
33+
'Client Id from https://dashboard.aspose.cloud/applications',
34+
'Client Secret from https://dashboard.aspose.cloud/applications'
3535
);
3636

3737
async function generate(api) {

example.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
const Barcode = require('aspose-barcode-cloud-node');
33

44
const config = new Barcode.Configuration(
5-
'App SID from https://dashboard.aspose.cloud/#/apps',
6-
'App Key from https://dashboard.aspose.cloud/#/apps'
5+
'Client Id from https://dashboard.aspose.cloud/applications',
6+
'Client Secret from https://dashboard.aspose.cloud/applications'
77
);
88

99
async function generate(api) {

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aspose-barcode-cloud-node",
3-
"version": "20.10.0",
3+
"version": "20.11.0",
44
"description": "Aspose.BarCode Cloud SDK for Node.js",
55
"homepage": "https://products.aspose.cloud/barcode/nodejs",
66
"repository": {
@@ -29,7 +29,7 @@
2929
"lint": "tsc --strict",
3030
"format": "tsdx lint --fix",
3131
"prepare": "tsdx build --target=node",
32-
"clear": "rm dist/* || DEL /S /Q dist",
32+
"clean": "rm dist/* ; rm built/* || true",
3333
"check-updates": "ncu -u"
3434
},
3535
"peerDependencies": {},

src/Configuration.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ export class Configuration {
3838
public authentication: Authentication;
3939

4040
/**
41-
* App SID.
41+
* Client Id.
4242
*/
43-
public appSID: string;
43+
public clientId: string;
4444

4545
/**
46-
* App key.
46+
* Client Secret.
4747
*/
48-
public appKey: string;
48+
public clientSecret: string;
4949

5050
/**
5151
* Base Url.
@@ -55,9 +55,9 @@ export class Configuration {
5555
readonly version: ApiVersion = ApiVersion.v3;
5656
readonly accessToken: string;
5757

58-
constructor(appSID: string, appKey: string, baseUrl?: string, accessToken?: string) {
59-
this.appSID = appSID;
60-
this.appKey = appKey;
58+
constructor(clientId: string, clientSecret: string, baseUrl?: string, accessToken?: string) {
59+
this.clientId = clientId;
60+
this.clientSecret = clientSecret;
6161
if (baseUrl) {
6262
this.baseUrl = baseUrl;
6363
} else {

src/JWTAuth.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ export class JWTAuth implements Authentication {
3232
}
3333

3434
public async applyUnauthorized(): Promise<void> {
35-
if (this._configuration.appSID && this._configuration.appKey) {
35+
if (this._configuration.clientId && this._configuration.clientSecret) {
3636
await this.requestToken();
3737
} else {
38-
throw new Error("Required 'appSID' or 'appKey' not specified in configuration.");
38+
throw new Error("Required 'clientId' or 'clientSecret' not specified in configuration.");
3939
}
4040
}
4141

@@ -46,8 +46,8 @@ export class JWTAuth implements Authentication {
4646
uri: this._configuration.baseUrl + '/connect/token',
4747
form: {
4848
grant_type: 'client_credentials',
49-
client_id: this._configuration.appSID,
50-
client_secret: this._configuration.appKey,
49+
client_id: this._configuration.clientId,
50+
client_secret: this._configuration.clientSecret,
5151
},
5252
};
5353

test/configuration.example.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"appSID": "App SID from https://dashboard.aspose.cloud/#/apps",
3-
"appKey": "App Key from https://dashboard.aspose.cloud/#/apps"
2+
"clientId": "Client Id from https://dashboard.aspose.cloud/applications",
3+
"clientSecret": "Client Secret from https://dashboard.aspose.cloud/applications"
44
}

test/configuration.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ describe('LoadConfigurationFromFile', () => {
77
it('should return Configuration', () => {
88
const config: Configuration = LoadConfigurationFromFile('./test/configuration.example.json');
99

10-
assert.strictEqual(config.appSID, 'App SID from https://dashboard.aspose.cloud/#/apps');
11-
assert.strictEqual(config.appKey, 'App Key from https://dashboard.aspose.cloud/#/apps');
10+
assert.strictEqual(config.clientId, 'Client Id from https://dashboard.aspose.cloud/applications');
11+
assert.strictEqual(config.clientSecret, 'Client Secret from https://dashboard.aspose.cloud/applications');
1212
assert.strictEqual(config.baseUrl, 'https://api.aspose.cloud');
1313
});
1414
});
@@ -17,8 +17,8 @@ describe('LoadConfigurationFromEnv', () => {
1717
it('should return Configuration', () => {
1818
const config = LoadConfigurationFromEnv();
1919

20-
assert.ok(config.hasOwnProperty('appSID'));
21-
assert.ok(config.hasOwnProperty('appKey'));
20+
assert.ok(config.hasOwnProperty('clientId'));
21+
assert.ok(config.hasOwnProperty('clientSecret'));
2222
assert.ok(config.hasOwnProperty('baseUrl'));
2323
});
2424
});
@@ -27,8 +27,8 @@ describe('LoadTestConfiguration', () => {
2727
it('should load something', () => {
2828
const config = LoadTestConfiguration();
2929

30-
assert.ok(config.hasOwnProperty('appSID'));
31-
assert.ok(config.hasOwnProperty('appKey'));
30+
assert.ok(config.hasOwnProperty('clientId'));
31+
assert.ok(config.hasOwnProperty('clientSecret'));
3232
assert.ok(config.hasOwnProperty('baseUrl'));
3333
});
3434
});

test/helpers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ export function LoadConfigurationFromFile(filename: string): Configuration {
66
const text: string = fs.readFileSync(filename, 'utf-8');
77
const json = JSON.parse(text);
88

9-
return new Configuration(json.appSID, json.appKey, json.baseUrl, json.accessToken);
9+
return new Configuration(json.clientId, json.clientSecret, json.baseUrl, json.accessToken);
1010
}
1111

1212
export function LoadConfigurationFromEnv(prefix?: string): Configuration {
1313
if (!prefix) {
1414
prefix = 'TEST_CONFIGURATION_';
1515
}
1616

17-
const appSID = process.env[prefix + 'APP_SID'];
18-
const appKey = process.env[prefix + 'APP_KEY'];
17+
const clientId = process.env[prefix + 'CLIENT_ID'];
18+
const clientSecret = process.env[prefix + 'CLIENT_SECRET'];
1919
const baseUrl = process.env[prefix + 'BASE_URL'];
2020
const accessToken = process.env[prefix + 'ACCESS_TOKEN'];
2121

22-
return new Configuration(appSID, appKey, baseUrl, accessToken);
22+
return new Configuration(clientId, clientSecret, baseUrl, accessToken);
2323
}
2424

2525
export function LoadTestConfiguration(): Configuration {

0 commit comments

Comments
 (0)