mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-01 17:50:06 +00:00
fix(executeJobSASjs): add parse webout response
This commit is contained in:
@@ -3,6 +3,7 @@ import { RequestClient } from './request/RequestClient'
|
|||||||
import { getAccessTokenForSasjs } from './auth/getAccessTokenForSasjs'
|
import { getAccessTokenForSasjs } from './auth/getAccessTokenForSasjs'
|
||||||
import { refreshTokensForSasjs } from './auth/refreshTokensForSasjs'
|
import { refreshTokensForSasjs } from './auth/refreshTokensForSasjs'
|
||||||
import { getAuthCodeForSasjs } from './auth/getAuthCodeForSasjs'
|
import { getAuthCodeForSasjs } from './auth/getAuthCodeForSasjs'
|
||||||
|
import { parseWeboutResponse } from './utils'
|
||||||
|
|
||||||
export class SASjsApiClient {
|
export class SASjsApiClient {
|
||||||
constructor(
|
constructor(
|
||||||
@@ -35,8 +36,13 @@ export class SASjsApiClient {
|
|||||||
log?: string
|
log?: string
|
||||||
logPath?: string
|
logPath?: string
|
||||||
error?: {}
|
error?: {}
|
||||||
|
_webout?: string
|
||||||
}>('SASjsApi/stp/execute', query, undefined)
|
}>('SASjsApi/stp/execute', query, undefined)
|
||||||
|
|
||||||
|
if (Object.keys(result).includes('_webout')) {
|
||||||
|
result._webout = parseWeboutResponse(result._webout!)
|
||||||
|
}
|
||||||
|
|
||||||
return Promise.resolve(result)
|
return Promise.resolve(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
export interface ExecutionQuery {
|
export interface ExecutionQuery {
|
||||||
_program: string
|
_program: string
|
||||||
_debug?: number
|
_debug?: number
|
||||||
_returnLog?: boolean
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export const parseWeboutResponse = (response: string, url?: string): string => {
|
|||||||
.split('>>weboutEND<<')[0]
|
.split('>>weboutEND<<')[0]
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (url) throw new WeboutResponseError(url)
|
if (url) throw new WeboutResponseError(url)
|
||||||
|
|
||||||
sasResponse = ''
|
sasResponse = ''
|
||||||
console.error(e)
|
console.error(e)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user