mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-14 23:50:06 +00:00
feat: parse response in webJobExecutor when server type is sasjs server
This commit is contained in:
@@ -113,6 +113,7 @@ export class WebJobExecutor extends BaseJobExecutor {
|
|||||||
const stringifiedData = JSON.stringify(data)
|
const stringifiedData = JSON.stringify(data)
|
||||||
if (
|
if (
|
||||||
config.serverType === ServerType.Sas9 ||
|
config.serverType === ServerType.Sas9 ||
|
||||||
|
config.serverType === ServerType.Sasjs ||
|
||||||
stringifiedData.length > 500000 ||
|
stringifiedData.length > 500000 ||
|
||||||
stringifiedData.includes(';')
|
stringifiedData.includes(';')
|
||||||
) {
|
) {
|
||||||
@@ -144,10 +145,23 @@ export class WebJobExecutor extends BaseJobExecutor {
|
|||||||
const requestPromise = new Promise((resolve, reject) => {
|
const requestPromise = new Promise((resolve, reject) => {
|
||||||
this.requestClient!.post(apiUrl, formData, undefined)
|
this.requestClient!.post(apiUrl, formData, undefined)
|
||||||
.then(async (res: any) => {
|
.then(async (res: any) => {
|
||||||
this.requestClient!.appendRequest(res, sasJob, config.debug)
|
|
||||||
|
|
||||||
let jsonResponse = res.result
|
let jsonResponse = res.result
|
||||||
|
|
||||||
|
if (this.serverType === ServerType.Sasjs && config.debug) {
|
||||||
|
this.requestClient!.appendRequest(
|
||||||
|
jsonResponse,
|
||||||
|
sasJob,
|
||||||
|
config.debug
|
||||||
|
)
|
||||||
|
jsonResponse = JSON.parse(parseWeboutResponse(jsonResponse._webout))
|
||||||
|
} else {
|
||||||
|
this.requestClient!.appendRequest(res, sasJob, config.debug)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.serverType === ServerType.Sasjs && !config.debug) {
|
||||||
|
jsonResponse = JSON.parse(jsonResponse._webout)
|
||||||
|
}
|
||||||
|
|
||||||
if (config.debug) {
|
if (config.debug) {
|
||||||
switch (this.serverType) {
|
switch (this.serverType) {
|
||||||
case ServerType.SasViya:
|
case ServerType.SasViya:
|
||||||
|
|||||||
Reference in New Issue
Block a user