Skip to content

Commit b10b854

Browse files
committed
Client credentials fields renamed
1 parent b6f338b commit b10b854

File tree

7 files changed

+19
-18
lines changed

7 files changed

+19
-18
lines changed

.github/workflows/npmpublish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
npm run compile
2020
- run: npm run test-pipeline
2121
env:
22-
appSid: ${{secrets.appSidProd}}
23-
appKey: ${{secrets.appKeyProd}}
22+
clientId: ${{secrets.appSidProd}}
23+
clientSecret: ${{secrets.appKeyProd}}
2424
apiBaseUrl: "https://api.aspose.cloud"
2525
- run: npm publish
2626
env:

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
npm run compile
1919
- name: Test
2020
env:
21-
appSid: ${{secrets.appSid}}
22-
appKey: ${{secrets.appKey}}
21+
clientId: ${{secrets.appSid}}
22+
clientSecret: ${{secrets.appKey}}
2323
apiBaseUrl: "https://api-qa.aspose.cloud"
2424
run: npm run test-pipeline

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ package-lock.json
33
dist
44
.vscode
55
.idea
6-
.nyc_output
6+
.nyc_output
7+
.run/

src/api/email-cloud.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ export class EmailCloud {
140140

141141

142142
/**
143-
* @param appSID App SID.
144-
* @param appKey App key.
143+
* @param clientId Client id.
144+
* @param clientSecret Client secret.
145145
* @param baseUrl Base api Url.
146146
* @param debugMode A value indicating whether debug mode. In debug mode all requests and responses are logged to console.
147147
*/
148-
constructor(appSID: string, appKey: string, baseUrl?: string, debugMode?: boolean) {
149-
this.configuration = new Configuration(appKey, appSID, baseUrl, debugMode);
148+
constructor(clientId: string, clientSecret: string, baseUrl?: string, debugMode?: boolean) {
149+
this.configuration = new Configuration(clientSecret, clientId, baseUrl, debugMode);
150150

151151
this._calendar = new CalendarApi(this.configuration);
152152

src/internal/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ export class JwtAuth implements IAuthentication {
7272

7373
private async requestToken(configuration: Configuration): Promise<void> {
7474
let postData = "grant_type=client_credentials";
75-
postData += "&client_id=" + configuration.appSID;
76-
postData += "&client_secret=" + configuration.appKey;
75+
postData += "&client_id=" + configuration.clientId;
76+
postData += "&client_secret=" + configuration.clientSecret;
7777

7878
const requestOptions: request.Options = {
7979
method: "POST",

src/internal/configuration.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ export class Configuration {
3737
/**
3838
* App SID.
3939
*/
40-
public appSID: string;
40+
public clientId: string;
4141

4242
/**
4343
* App key.
4444
*/
45-
public appKey: string;
45+
public clientSecret: string;
4646

4747
/**
4848
* Base Url.
@@ -70,8 +70,8 @@ export class Configuration {
7070
*/
7171
public onPremise: boolean = false;
7272

73-
constructor(appKey: string, appSID: string, baseUrl?: string, debugMode?: boolean, apiVersion?: string) {
74-
if (appKey && appSID) {
73+
constructor(clientSecret: string, clientId: string, baseUrl?: string, debugMode?: boolean, apiVersion?: string) {
74+
if (clientSecret && clientId) {
7575
this.onPremise = false;
7676
} else if (baseUrl) {
7777
this.onPremise = true;
@@ -86,8 +86,8 @@ export class Configuration {
8686
}
8787
this.authUrl = this.baseUrl;
8888

89-
this.appSID = appSID;
90-
this.appKey = appKey;
89+
this.clientId = clientId;
90+
this.clientSecret = clientSecret;
9191
this.debugMode = debugMode;
9292

9393
if (apiVersion) {

test/suite-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function suiteBase(suite: Suite): SuiteBase {
3030
const storage = 'First Storage';
3131
suite.timeout(100000);
3232
suite.beforeAll(async () => {
33-
api = new EmailCloud(process.env.appSid, process.env.appKey, process.env.apiBaseUrl);
33+
api = new EmailCloud(process.env.clientId, process.env.clientSecret, process.env.apiBaseUrl);
3434
const authUrl = process.env.authUrl;
3535
if (authUrl != null) api.configuration.authUrl = authUrl;
3636
folder = uuidv4();

0 commit comments

Comments
 (0)