1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-15 16:10:06 +00:00

Merge pull request #649 from sasjs/sasjs-server-log-parsing

fix: adopted new log structure of SASJS server
This commit is contained in:
Allan Bowe
2022-02-20 23:27:36 +02:00
committed by GitHub
2 changed files with 11 additions and 2 deletions

View File

@@ -52,9 +52,13 @@ export class SasJsJobExecutor extends BaseJobExecutor {
authConfig?.access_token authConfig?.access_token
) )
.then(async (res: any) => { .then(async (res: any) => {
const parsedSasjsServerLog = res.result.log
.map((logLine: any) => logLine.line)
.join('\n')
const resObj = { const resObj = {
result: res.result._webout, result: res.result._webout,
log: res.result.log log: parsedSasjsServerLog
} }
this.requestClient!.appendRequest(resObj, sasJob, config.debug) this.requestClient!.appendRequest(resObj, sasJob, config.debug)

View File

@@ -146,11 +146,16 @@ export class WebJobExecutor extends BaseJobExecutor {
const requestPromise = new Promise((resolve, reject) => { const requestPromise = new Promise((resolve, reject) => {
this.requestClient!.post(apiUrl, formData, authConfig?.access_token) this.requestClient!.post(apiUrl, formData, authConfig?.access_token)
.then(async (res: any) => { .then(async (res: any) => {
const parsedSasjsServerLog =
this.serverType === ServerType.Sasjs
? res.result.log.map((logLine: any) => logLine.line).join('\n')
: res.result.log
const resObj = const resObj =
this.serverType === ServerType.Sasjs this.serverType === ServerType.Sasjs
? { ? {
result: res.result._webout, result: res.result._webout,
log: res.result.log log: parsedSasjsServerLog
} }
: res : res
this.requestClient!.appendRequest(resObj, sasJob, config.debug) this.requestClient!.appendRequest(resObj, sasJob, config.debug)