Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit a548eaf

Browse files
authored
Merge pull request #399 from Alfresco/development
3.1.0
2 parents 0b0ca54 + 2c7e78d commit a548eaf

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alfresco/js-api",
3-
"version": "3.0.0",
3+
"version": "3.1.0",
44
"description": "JavaScript client library for the Alfresco REST API",
55
"author": "Alfresco Software, Ltd.",
66
"main": "index.js",

src/api/content-rest-api/api/webscript.api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class WebscriptApi extends BaseApi {
4848
*
4949
* @returns {Promise} A promise that is resolved return the webScript data and {error} if rejected.
5050
*/
51-
executeWebScript(httpMethod: string, scriptPath: string, scriptArgs: string, contextRoot: string, servicePath: string, postBody?: any): Promise<any> {
51+
executeWebScript(httpMethod: string, scriptPath: string, scriptArgs?: any, contextRoot?: string, servicePath?: string, postBody?: any): Promise<any> {
5252
contextRoot = contextRoot || 'alfresco';
5353
servicePath = servicePath || 'service';
5454
postBody = postBody || null;

src/api/gs-classification-rest-api/api/defaultClassificationValues.api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import { DeclassificationDate } from '../model/declassificationDate';
1919
import { BaseApi } from './base.api';
20-
import { DateAlfresco } from '../../../../dist/src/api/content-rest-api/model/dateAlfresco';
20+
import { DateAlfresco } from '../../../../src/api/content-rest-api/model/dateAlfresco';
2121

2222
/**
2323
* Defaultclassificationvalues service.

src/api/gs-classification-rest-api/model/declassificationDate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { DateAlfresco } from '../../../../dist/src/api/content-rest-api/model/dateAlfresco';
18+
import { DateAlfresco } from '../../../../src/api/content-rest-api/model/dateAlfresco';
1919

2020
export type DeclassificationDate = DateAlfresco;

src/authentication/oauth2Auth.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,14 @@ export class Oauth2Auth extends AlfrescoApiClient {
159159
this.emit('discovery', this.discovery);
160160
this.storage.setItem('discovery', JSON.stringify(this.discovery));
161161
resolve(discovery);
162-
}, (error) => {
162+
}, (error) => {
163+
this.emit('error', error);
164+
this.storage.removeItem('discovery');
163165
reject(error.error);
164166
});
165167
} else {
166168
this.emit('discovery', this.discovery);
169+
this.storage.setItem('discovery', JSON.stringify(this.discovery));
167170
resolve(this.discovery);
168171
}
169172
});
@@ -192,7 +195,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
192195
this.emit('jwks', jwks);
193196
this.storage.setItem('jwks', JSON.stringify(jwks));
194197
resolve(jwks);
195-
}, (error) => {
198+
}, (error) => {
196199
reject(error.error);
197200
});
198201
} else {
@@ -236,7 +239,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
236239
this.silentRefresh();
237240
resolve(accessToken);
238241
}
239-
}, (error) => {
242+
}, (error) => {
240243
reject('Validation JWT error' + error);
241244
});
242245
} else {
@@ -520,7 +523,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
520523
setTimeout(() => {
521524
this.destroyIframe();
522525
this.createIframe();
523-
}, this.config.oauth2.refreshTokenTimeout);
526+
}, this.config.oauth2.refreshTokenTimeout);
524527
}
525528

526529
removeHashFromSilentIframe() {
@@ -577,11 +580,8 @@ export class Oauth2Auth extends AlfrescoApiClient {
577580
grantPasswordLogin(username: string, password: string, resolve: any, reject: any) {
578581
let postBody = {}, pathParams = {}, queryParams = {};
579582

580-
let authHeader = this.basicAuth(this.authentications.basicAuth.username, this.authentications.basicAuth.password);
581-
582583
let headerParams = {
583-
'Content-Type': 'application/x-www-form-urlencoded',
584-
'Authorization': authHeader
584+
'Content-Type': 'application/x-www-form-urlencoded'
585585
};
586586

587587
let formParams = {
@@ -606,7 +606,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
606606
resolve(data);
607607
},
608608
(error) => {
609-
if (error.error.status === 401) {
609+
if (error.error && error.error.status === 401) {
610610
this.emit('unauthorized');
611611
}
612612
this.emit('error');

0 commit comments

Comments
 (0)