mirror of
https://github.com/sasjs/server.git
synced 2026-01-07 22:50:05 +00:00
feat: parse log to array
This commit is contained in:
@@ -3,6 +3,7 @@ import { Request, Security, Route, Tags, Post, Body } from 'tsoa'
|
||||
import { ExecuteReturnJson, ExecutionController } from './internal'
|
||||
import { PreProgramVars } from '../types'
|
||||
import { ExecuteReturnJsonResponse } from '.'
|
||||
import { parseLogToArray } from '../utils'
|
||||
|
||||
interface ExecuteSASCodePayload {
|
||||
/**
|
||||
@@ -43,7 +44,7 @@ const executeSASCode = async (req: any, { code }: ExecuteSASCodePayload) => {
|
||||
return {
|
||||
status: 'success',
|
||||
_webout: webout,
|
||||
log,
|
||||
log: parseLogToArray(log),
|
||||
httpHeaders
|
||||
}
|
||||
} catch (err: any) {
|
||||
|
||||
@@ -18,7 +18,13 @@ import {
|
||||
ExecutionVars
|
||||
} from './internal'
|
||||
import { PreProgramVars } from '../types'
|
||||
import { getTmpFilesFolderPath, HTTPHeaders, makeFilesNamesMap } from '../utils'
|
||||
import {
|
||||
getTmpFilesFolderPath,
|
||||
HTTPHeaders,
|
||||
LogLine,
|
||||
makeFilesNamesMap,
|
||||
parseLogToArray
|
||||
} from '../utils'
|
||||
|
||||
interface ExecuteReturnJsonPayload {
|
||||
/**
|
||||
@@ -30,7 +36,7 @@ interface ExecuteReturnJsonPayload {
|
||||
export interface ExecuteReturnJsonResponse {
|
||||
status: string
|
||||
_webout: string
|
||||
log?: string
|
||||
log: LogLine[]
|
||||
message?: string
|
||||
httpHeaders: HTTPHeaders
|
||||
}
|
||||
@@ -70,6 +76,7 @@ export class STPController {
|
||||
@Example<ExecuteReturnJsonResponse>({
|
||||
status: 'success',
|
||||
_webout: 'webout content',
|
||||
log: [],
|
||||
httpHeaders: {
|
||||
'Content-type': 'application/zip',
|
||||
'Cache-Control': 'public, max-age=1000'
|
||||
@@ -141,7 +148,7 @@ const executeReturnJson = async (
|
||||
return {
|
||||
status: 'success',
|
||||
_webout: webout,
|
||||
log,
|
||||
log: parseLogToArray(log),
|
||||
httpHeaders
|
||||
}
|
||||
} catch (err: any) {
|
||||
|
||||
Reference in New Issue
Block a user