1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-07 12:30:06 +00:00

feat: select extra attributes in JES response

This commit is contained in:
2021-06-08 13:25:08 +02:00
parent e4f23334d3
commit 2fa3a353fa
4 changed files with 43 additions and 8 deletions

View File

@@ -14,6 +14,7 @@ import {
Sas9JobExecutor
} from './job-execution'
import { ErrorResponse } from './types/errors'
import { ExtraResponseAttributes } from './types/ExtraResponseAttributes'
const defaultConfig: SASjsConfig = {
serverUrl: '',
@@ -540,13 +541,17 @@ export default class SASjs {
* `await request(sasJobPath, data, config, () => setIsLoggedIn(false))`
* If you are not passing in any data and configuration, it will look like so:
* `await request(sasJobPath, {}, {}, () => setIsLoggedIn(false))`
* @param extraResponseAttributes - a array of predefined values that are used
* to provide extra attributes (same names as those values) to be added in response
* Supported values: 'file' | 'output' | 'data'
*/
public async request(
sasJob: string,
data: { [key: string]: any },
config: { [key: string]: any } = {},
loginRequiredCallback?: () => any,
accessToken?: string
accessToken?: string,
extraResponseAttributes: ExtraResponseAttributes[] = []
) {
config = {
...this.sasjsConfig,
@@ -568,7 +573,8 @@ export default class SASjs {
data,
config,
loginRequiredCallback,
accessToken
accessToken,
extraResponseAttributes
)
}
} else if (