mirror of
https://github.com/sasjs/adapter.git
synced 2026-06-08 18:20:20 +00:00
fix(debug): use _debug=128 instead of log for viya web with tasks
This commit is contained in:
@@ -60,7 +60,7 @@ export abstract class BaseJobExecutor implements JobExecutor {
|
|||||||
config.useComputeApi === null &&
|
config.useComputeApi === null &&
|
||||||
config.serverType === ServerType.SasViya &&
|
config.serverType === ServerType.SasViya &&
|
||||||
config.runAsTask === true
|
config.runAsTask === true
|
||||||
? 'log'
|
? 128
|
||||||
: 131
|
: 131
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { getValidJson } from './getValidJson'
|
|||||||
import { parseWeboutResponse } from './parseWeboutResponse'
|
import { parseWeboutResponse } from './parseWeboutResponse'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When querying a Viya job using the Web approach with _DEBUG=log (used when
|
* When querying a Viya job using the Web approach with _DEBUG=128 (used when
|
||||||
* runAsTask is true), the webout JSON is inlined into the response via:
|
* runAsTask is true), the webout JSON is inlined into the response via:
|
||||||
* var blob = new Blob([`{...}`], {type: 'application/json'});
|
* var blob = new Blob([`{...}`], {type: 'application/json'});
|
||||||
* On abort/error paths the same shape is used but with text/plain and
|
* On abort/error paths the same shape is used but with text/plain and
|
||||||
@@ -10,7 +10,12 @@ import { parseWeboutResponse } from './parseWeboutResponse'
|
|||||||
* var blob = new Blob([`>>weboutBEGIN<<\n{...}\n>>weboutEND<<\n`], {type: 'text/plain'});
|
* var blob = new Blob([`>>weboutBEGIN<<\n{...}\n>>weboutEND<<\n`], {type: 'text/plain'});
|
||||||
* No follow-up request is needed — extract and parse the JSON directly.
|
* No follow-up request is needed — extract and parse the JSON directly.
|
||||||
*/
|
*/
|
||||||
export const parseSasViyaLogDebugResponse = async (response: string) => {
|
export const parseSasViyaLogDebugResponse = async (response: any) => {
|
||||||
|
// If upstream already parsed the response as JSON (object), pass through.
|
||||||
|
if (typeof response !== 'string') {
|
||||||
|
return response
|
||||||
|
}
|
||||||
|
|
||||||
const blobMatch = response.match(
|
const blobMatch = response.match(
|
||||||
/new Blob\(\[`([\s\S]*?)`\],\s*\{type:\s*'(?:application\/json|text\/plain)'\}\)/
|
/new Blob\(\[`([\s\S]*?)`\],\s*\{type:\s*'(?:application\/json|text\/plain)'\}\)/
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user