1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-07 12:30:06 +00:00

feat(log): made 'fetchLogFileContent' method public

This commit is contained in:
Yury Shkoda
2020-10-30 10:36:04 +03:00
parent a07eabc408
commit 7e2cb8491f

View File

@@ -1264,10 +1264,19 @@ export default class SASjs {
}
}
private fetchLogFileContent(logLink: string) {
/**
* Fetches content of the log file
* @param logLink - url of the log file.
* @param accessToken - an access token for an authorized user.
*/
public fetchLogFileContent(logLink: string, accessToken: string) {
return new Promise((resolve, reject) => {
fetch(logLink, {
method: 'GET'
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + accessToken
}
})
.then((response: any) => response.text())
.then((response: any) => resolve(response))