attlaz-client 1.13.13 → 1.13.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Http/OAuthClient.js
CHANGED
|
@@ -177,7 +177,14 @@ export class OAuthClient {
|
|
|
177
177
|
return typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
|
|
178
178
|
}
|
|
179
179
|
tokenToOauthClientToken(oauthToken) {
|
|
180
|
-
|
|
180
|
+
let scopes = '';
|
|
181
|
+
if (Object.prototype.hasOwnProperty.call(oauthToken.data, 'scopes')) {
|
|
182
|
+
scopes = oauthToken.data.scopes;
|
|
183
|
+
}
|
|
184
|
+
else if (Object.prototype.hasOwnProperty.call(oauthToken.data, 'scope')) {
|
|
185
|
+
scopes = oauthToken.data.scope;
|
|
186
|
+
}
|
|
187
|
+
const token = new OAuthClientToken(oauthToken.accessToken, oauthToken.tokenType, oauthToken.refreshToken, scopes);
|
|
181
188
|
const rawTokenExpires = oauthToken.expires;
|
|
182
189
|
if (rawTokenExpires !== null && rawTokenExpires !== undefined) {
|
|
183
190
|
token.expires = rawTokenExpires;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Endpoint } from './Endpoint.js';
|
|
2
|
-
import { Utils } from '../Utils.js';
|
|
3
2
|
import { CodeSourceAccount } from '../Model/Deployment/CodeSourceAccount.js';
|
|
4
3
|
import { CodeSource } from '../Model/Deployment/CodeSource.js';
|
|
5
4
|
import { HttpClient } from '../Http/HttpClient.js';
|
|
@@ -61,7 +60,6 @@ export class SourcesAccountEndpoint extends Endpoint {
|
|
|
61
60
|
return rawSourcesAccountRepositories;
|
|
62
61
|
}
|
|
63
62
|
async getRepositoryBranches(codeSourceAccountId, repositoryKey, pagination = null) {
|
|
64
|
-
repositoryKey = Utils.base64encode(repositoryKey);
|
|
65
63
|
const queryString = new QueryString('codesourceaccounts/' + codeSourceAccountId + '/repositories/' + repositoryKey + '/branches');
|
|
66
64
|
queryString.addPagination(pagination);
|
|
67
65
|
const rawBranches = await this.requestCollection(queryString, SourcesAccountRepositoryBranch.parse);
|
package/dist/Utils.js
CHANGED
|
@@ -45,7 +45,7 @@ export class Utils {
|
|
|
45
45
|
if (input === null || input === undefined || input === '') {
|
|
46
46
|
return '';
|
|
47
47
|
}
|
|
48
|
-
return Buffer.from(input).toString('base64');
|
|
48
|
+
return Buffer.from(input.toString()).toString('base64');
|
|
49
49
|
}
|
|
50
50
|
static base64decode(encodedString) {
|
|
51
51
|
if (encodedString === null || encodedString === undefined || encodedString === '') {
|