1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 09:24:35 +00:00

Merge pull request #356 from sasjs/issue657

fix: increasing timeout, closes #657
This commit is contained in:
Muhammad Saad
2021-05-10 16:17:14 +05:00
committed by GitHub
6 changed files with 23 additions and 34 deletions

View File

@@ -314,9 +314,7 @@ export class ContextManager {
contextId: string,
accessToken?: string
): Promise<ContextAllAttributes> {
const {
result: context
} = await this.requestClient
const { result: context } = await this.requestClient
.get<ContextAllAttributes>(
`${this.serverUrl}/compute/contexts/${contextId}`,
accessToken

View File

@@ -594,9 +594,8 @@ export class SASViyaApiClient {
}
}
const {
result: createFolderResponse
} = await this.requestClient.post<Folder>(
const { result: createFolderResponse } =
await this.requestClient.post<Folder>(
`/folders/folders?parentFolderUri=${parentFolderUri}`,
{
name: folderName,
@@ -875,9 +874,7 @@ export class SASViyaApiClient {
throw new Error(`URI of job definition was not found.`)
}
const {
result: jobDefinition
} = await this.requestClient
const { result: jobDefinition } = await this.requestClient
.get<JobDefinition>(
`${this.serverUrl}${jobDefinitionLink.href}`,
accessToken
@@ -1103,7 +1100,7 @@ export class SASViyaApiClient {
const { result: state } = await this.requestClient
.get<string>(
`${this.serverUrl}${stateLink.href}?_action=wait&wait=30`,
`${this.serverUrl}${stateLink.href}?_action=wait&wait=300`,
accessToken,
'text/plain',
{},
@@ -1130,7 +1127,7 @@ export class SASViyaApiClient {
if (stateLink) {
const { result: jobState } = await this.requestClient
.get<string>(
`${this.serverUrl}${stateLink.href}?_action=wait&wait=30`,
`${this.serverUrl}${stateLink.href}?_action=wait&wait=300`,
accessToken,
'text/plain',
{},

View File

@@ -91,10 +91,7 @@ export class SessionManager {
}
private async createAndWaitForSession(accessToken?: string) {
const {
result: createdSession,
etag
} = await this.requestClient
const { result: createdSession, etag } = await this.requestClient
.post<Session>(
`${this.serverUrl}/compute/contexts/${
this.currentContext!.id

View File

@@ -71,10 +71,8 @@ export class WebJobExecutor extends BaseJobExecutor {
} else {
// param based approach
try {
const {
formData: newFormData,
requestParams: params
} = generateTableUploadForm(formData, data)
const { formData: newFormData, requestParams: params } =
generateTableUploadForm(formData, data)
formData = newFormData
requestParams = { ...requestParams, ...params }
} catch (e) {

View File

@@ -214,9 +214,8 @@ export class RequestClient implements HttpClient {
const headers = this.getHeaders(accessToken, 'application/json')
if (this.fileUploadCsrfToken?.value) {
headers[
this.fileUploadCsrfToken.headerName
] = this.fileUploadCsrfToken.value
headers[this.fileUploadCsrfToken.headerName] =
this.fileUploadCsrfToken.value
}
try {
@@ -333,9 +332,9 @@ export class RequestClient implements HttpClient {
}
private parseCsrfToken = (response: AxiosResponse): CsrfToken | undefined => {
const tokenHeader = (response.headers[
'x-csrf-header'
] as string)?.toLowerCase()
const tokenHeader = (
response.headers['x-csrf-header'] as string
)?.toLowerCase()
if (tokenHeader) {
const token = response.headers[tokenHeader]

View File

@@ -28,12 +28,12 @@ describe('urlValidator', () => {
it('should return false when the URL is null', () => {
const url = null
expect(isUrl((url as unknown) as string)).toEqual(false)
expect(isUrl(url as unknown as string)).toEqual(false)
})
it('should return false when the URL is undefined', () => {
const url = undefined
expect(isUrl((url as unknown) as string)).toEqual(false)
expect(isUrl(url as unknown as string)).toEqual(false)
})
})