mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-05 11:40:06 +00:00
chore: code refactor renamed variables/functions
This commit is contained in:
@@ -14,13 +14,11 @@ import { RequestClient } from '../request/RequestClient'
|
|||||||
import { SASViyaApiClient } from '../SASViyaApiClient'
|
import { SASViyaApiClient } from '../SASViyaApiClient'
|
||||||
import {
|
import {
|
||||||
isRelativePath,
|
isRelativePath,
|
||||||
getValidJson,
|
|
||||||
parseSasViyaDebugResponse,
|
parseSasViyaDebugResponse,
|
||||||
appendExtraResponseAttributes
|
appendExtraResponseAttributes
|
||||||
} from '../utils'
|
} from '../utils'
|
||||||
import { BaseJobExecutor } from './JobExecutor'
|
import { BaseJobExecutor } from './JobExecutor'
|
||||||
import { parseWeboutResponse } from '../utils/parseWeboutResponse'
|
import { parseWeboutResponse } from '../utils/parseWeboutResponse'
|
||||||
import { isLoggedInSASVIYA } from '../auth/verifyingPopUpLoginSASVIYA'
|
|
||||||
|
|
||||||
export interface WaitingRequstPromise {
|
export interface WaitingRequstPromise {
|
||||||
promise: Promise<any> | null
|
promise: Promise<any> | null
|
||||||
@@ -47,11 +45,6 @@ export class WebJobExecutor extends BaseJobExecutor {
|
|||||||
extraResponseAttributes: ExtraResponseAttributes[] = []
|
extraResponseAttributes: ExtraResponseAttributes[] = []
|
||||||
) {
|
) {
|
||||||
const loginCallback = loginRequiredCallback || (() => Promise.resolve())
|
const loginCallback = loginRequiredCallback || (() => Promise.resolve())
|
||||||
|
|
||||||
if (this.serverType === ServerType.SasViya && !isLoggedInSASVIYA()) {
|
|
||||||
await loginCallback()
|
|
||||||
}
|
|
||||||
|
|
||||||
const program = isRelativePath(sasJob)
|
const program = isRelativePath(sasJob)
|
||||||
? config.appLoc
|
? config.appLoc
|
||||||
? config.appLoc.replace(/\/?$/, '/') + sasJob.replace(/^\//, '')
|
? config.appLoc.replace(/\/?$/, '/') + sasJob.replace(/^\//, '')
|
||||||
@@ -60,10 +53,7 @@ export class WebJobExecutor extends BaseJobExecutor {
|
|||||||
let apiUrl = `${config.serverUrl}${this.jobsPath}/?${'_program=' + program}`
|
let apiUrl = `${config.serverUrl}${this.jobsPath}/?${'_program=' + program}`
|
||||||
|
|
||||||
if (config.serverType === ServerType.SasViya) {
|
if (config.serverType === ServerType.SasViya) {
|
||||||
const jobUri =
|
const jobUri = await this.getJobUri(sasJob)
|
||||||
config.serverType === ServerType.SasViya
|
|
||||||
? await this.getJobUri(sasJob)
|
|
||||||
: ''
|
|
||||||
|
|
||||||
apiUrl += jobUri.length > 0 ? '&_job=' + jobUri : ''
|
apiUrl += jobUri.length > 0 ? '&_job=' + jobUri : ''
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user