1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-07 04:20:05 +00:00

chore(deps): added prettier dev dependency

This commit is contained in:
Yury Shkoda
2022-06-20 19:36:12 +03:00
parent 489947bcae
commit a113c95441
59 changed files with 257 additions and 242 deletions

View File

@@ -55,25 +55,24 @@ export async function executeScript(
try {
let executionSessionId: string
const session = await sessionManager.getSession(access_token).catch(err => {
throw prefixMessage(err, 'Error while getting session. ')
})
const session = await sessionManager
.getSession(access_token)
.catch((err) => {
throw prefixMessage(err, 'Error while getting session. ')
})
executionSessionId = session!.id
if (printPid) {
const { result: jobIdVariable } = await sessionManager
.getVariable(executionSessionId, 'SYSJOBID', access_token)
.catch(err => {
.catch((err) => {
throw prefixMessage(err, 'Error while getting session variable. ')
})
if (jobIdVariable && jobIdVariable.value) {
const relativeJobPath = rootFolderName
? jobPath
.split(rootFolderName)
.join('')
.replace(/^\//, '')
? jobPath.split(rootFolderName).join('').replace(/^\//, '')
: jobPath
const logger = process.logger || console
@@ -127,7 +126,7 @@ export async function executeScript(
if (data) {
if (JSON.stringify(data).includes(';')) {
files = await uploadTables(requestClient, data, access_token).catch(
err => {
(err) => {
throw prefixMessage(err, 'Error while uploading tables. ')
}
)
@@ -160,7 +159,7 @@ export async function executeScript(
jobRequestBody,
access_token
)
.catch(err => {
.catch((err) => {
throw prefixMessage(err, 'Error while posting job. ')
})
@@ -181,7 +180,7 @@ export async function executeScript(
debug,
authConfig,
pollOptions
).catch(async err => {
).catch(async (err) => {
const error = err?.response?.data
const result = /err=[0-9]*,/.exec(error)
@@ -209,14 +208,14 @@ export async function executeScript(
`/compute/sessions/${executionSessionId}/jobs/${postedJob.id}`,
access_token
)
.catch(err => {
.catch((err) => {
throw prefixMessage(err, 'Error while getting job. ')
})
let jobResult
let log = ''
const logLink = currentJob.links.find(l => l.rel === 'log')
const logLink = currentJob.links.find((l) => l.rel === 'log')
if (debug && logLink) {
const logUrl = `${logLink.href}/content`
@@ -241,7 +240,7 @@ export async function executeScript(
jobResult = await requestClient
.get<any>(resultLink, access_token, 'text/plain')
.catch(async e => {
.catch(async (e) => {
if (e instanceof NotFoundError) {
if (logLink) {
const logUrl = `${logLink.href}/content`
@@ -267,7 +266,7 @@ export async function executeScript(
await sessionManager
.clearSession(executionSessionId, access_token)
.catch(err => {
.catch((err) => {
throw prefixMessage(err, 'Error while clearing session. ')
})