mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-08 21:10:05 +00:00
chore(git): Merge branch 'master' into sas9-extract-username
This commit is contained in:
12
package-lock.json
generated
12
package-lock.json
generated
@@ -14017,9 +14017,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/terser": {
|
"node_modules/terser": {
|
||||||
"version": "5.14.1",
|
"version": "5.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/terser/-/terser-5.15.0.tgz",
|
||||||
"integrity": "sha512-+ahUAE+iheqBTDxXhTisdA8hgvbEG1hHOQ9xmNjeUJSoi6DU/gMrKNcfZjHkyY6Alnuyc+ikYJaxxfHkT3+WuQ==",
|
"integrity": "sha512-L1BJiXVmheAQQy+as0oF3Pwtlo4s3Wi1X2zNZ2NxOB4wx9bdS9Vk67XQENLFdLYGCK/Z2di53mTj/hBafR+dTA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jridgewell/source-map": "^0.3.2",
|
"@jridgewell/source-map": "^0.3.2",
|
||||||
@@ -26052,9 +26052,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"terser": {
|
"terser": {
|
||||||
"version": "5.14.1",
|
"version": "5.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/terser/-/terser-5.15.0.tgz",
|
||||||
"integrity": "sha512-+ahUAE+iheqBTDxXhTisdA8hgvbEG1hHOQ9xmNjeUJSoi6DU/gMrKNcfZjHkyY6Alnuyc+ikYJaxxfHkT3+WuQ==",
|
"integrity": "sha512-L1BJiXVmheAQQy+as0oF3Pwtlo4s3Wi1X2zNZ2NxOB4wx9bdS9Vk67XQENLFdLYGCK/Z2di53mTj/hBafR+dTA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@jridgewell/source-map": "^0.3.2",
|
"@jridgewell/source-map": "^0.3.2",
|
||||||
|
|||||||
@@ -846,7 +846,11 @@ export default class SASjs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async executeJobSASjs(query: ExecutionQuery, authConfig?: AuthConfig) {
|
public async executeJobSASjs(query: ExecutionQuery, authConfig?: AuthConfig) {
|
||||||
return await this.sasJSApiClient?.executeJob(query, authConfig)
|
return await this.sasJSApiClient?.executeJob(
|
||||||
|
query,
|
||||||
|
this.sasjsConfig.appLoc,
|
||||||
|
authConfig
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { ExecutionQuery } from './types'
|
|||||||
import { RequestClient } from './request/RequestClient'
|
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 { parseWeboutResponse, SASJS_LOGS_SEPARATOR } from './utils'
|
|
||||||
import { getTokens } from './auth/getTokens'
|
import { getTokens } from './auth/getTokens'
|
||||||
|
|
||||||
export class SASjsApiClient {
|
export class SASjsApiClient {
|
||||||
@@ -42,23 +41,25 @@ export class SASjsApiClient {
|
|||||||
return Promise.resolve(result)
|
return Promise.resolve(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async executeJob(query: ExecutionQuery, authConfig?: AuthConfig) {
|
public async executeJob(
|
||||||
|
query: ExecutionQuery,
|
||||||
|
appLoc: string,
|
||||||
|
authConfig?: AuthConfig
|
||||||
|
) {
|
||||||
const access_token = authConfig ? authConfig.access_token : undefined
|
const access_token = authConfig ? authConfig.access_token : undefined
|
||||||
|
|
||||||
const { result } = await this.requestClient.post<{
|
let _program
|
||||||
status: string
|
if (query._program.startsWith('/')) {
|
||||||
message: string
|
_program = query._program
|
||||||
log?: string
|
} else _program = `${appLoc}/${query._program}`
|
||||||
logPath?: string
|
|
||||||
error?: {}
|
|
||||||
_webout?: string
|
|
||||||
}>('SASjsApi/stp/execute', query, access_token)
|
|
||||||
|
|
||||||
if (Object.keys(result).includes('_webout')) {
|
const response: any = await this.requestClient.post(
|
||||||
result._webout = parseWeboutResponse(result._webout!)
|
'SASjsApi/stp/execute',
|
||||||
}
|
{ _debug: 131, ...query, _program },
|
||||||
|
access_token
|
||||||
|
)
|
||||||
|
|
||||||
return Promise.resolve(result)
|
return { result: response.result, log: response.log }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user