1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 01:14:36 +00:00

fix(executeJobSASjs): add parse webout response

This commit is contained in:
Yury Shkoda
2022-02-11 13:10:38 +03:00
parent b1979f63ef
commit 30a99f9cc5
3 changed files with 7 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import { RequestClient } from './request/RequestClient'
import { getAccessTokenForSasjs } from './auth/getAccessTokenForSasjs'
import { refreshTokensForSasjs } from './auth/refreshTokensForSasjs'
import { getAuthCodeForSasjs } from './auth/getAuthCodeForSasjs'
import { parseWeboutResponse } from './utils'
export class SASjsApiClient {
constructor(
@@ -35,8 +36,13 @@ export class SASjsApiClient {
log?: string
logPath?: string
error?: {}
_webout?: string
}>('SASjsApi/stp/execute', query, undefined)
if (Object.keys(result).includes('_webout')) {
result._webout = parseWeboutResponse(result._webout!)
}
return Promise.resolve(result)
}

View File

@@ -1,5 +1,4 @@
export interface ExecutionQuery {
_program: string
_debug?: number
_returnLog?: boolean
}

View File

@@ -10,6 +10,7 @@ export const parseWeboutResponse = (response: string, url?: string): string => {
.split('>>weboutEND<<')[0]
} catch (e) {
if (url) throw new WeboutResponseError(url)
sasResponse = ''
console.error(e)
}