mirror of
https://github.com/sasjs/adapter.git
synced 2026-06-08 18:20:20 +00:00
feat(viya): add runAsTask config feature for execution tasks
This commit is contained in:
@@ -102,6 +102,10 @@ export class WebJobExecutor extends BaseJobExecutor {
|
|||||||
apiUrl += config.contextName?.trim()
|
apiUrl += config.contextName?.trim()
|
||||||
? `&_contextname=${encodeURIComponent(config.contextName)}`
|
? `&_contextname=${encodeURIComponent(config.contextName)}`
|
||||||
: ''
|
: ''
|
||||||
|
|
||||||
|
if (config.runAsTask === true) {
|
||||||
|
apiUrl += '&_executionTasks=true'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let requestParams = {
|
let requestParams = {
|
||||||
@@ -116,8 +120,7 @@ export class WebJobExecutor extends BaseJobExecutor {
|
|||||||
|
|
||||||
// FIXME(viya - SAS Track CS0409737): remove when Viya stops rejecting empty multipart on
|
// FIXME(viya - SAS Track CS0409737): remove when Viya stops rejecting empty multipart on
|
||||||
// _executionTasks=true. Dummy file keeps the body non-empty
|
// _executionTasks=true. Dummy file keeps the body non-empty
|
||||||
const hasExecutionTasksFlag =
|
const hasExecutionTasksFlag = config.runAsTask === true
|
||||||
sasJob.includes('_executionTasks=true') || config.runAsTask === true
|
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
const stringifiedData = JSON.stringify(data)
|
const stringifiedData = JSON.stringify(data)
|
||||||
|
|||||||
@@ -79,6 +79,14 @@ export class SASjsConfig {
|
|||||||
* may affect browser performance, especially with debug (logs) enabled.
|
* may affect browser performance, especially with debug (logs) enabled.
|
||||||
*/
|
*/
|
||||||
requestHistoryLimit?: number = 10
|
requestHistoryLimit?: number = 10
|
||||||
|
/**
|
||||||
|
* Optional setting. When `true`, the request runs as a Viya execution task —
|
||||||
|
* appends `_executionTasks=true` to the request URL. Only applies to the Viya
|
||||||
|
* web jobs path, i.e. when `serverType === SASVIYA` AND
|
||||||
|
* `useComputeApi` is `null`/`undefined`. Has no effect when `useComputeApi`
|
||||||
|
* is explicitly set to `true` or `false`.
|
||||||
|
*/
|
||||||
|
runAsTask?: boolean = false
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum LoginMechanism {
|
export enum LoginMechanism {
|
||||||
|
|||||||
Reference in New Issue
Block a user