1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-06 22:20:06 +00:00

fix(execute): added atribute indicating stp api

This commit is contained in:
Yury Shkoda
2023-05-02 15:18:05 +03:00
parent bd1b58086d
commit e78f87f5c0
3 changed files with 25 additions and 18 deletions

View File

@@ -3,8 +3,6 @@ import { Request, Security, Route, Tags, Post, Body, Get, Query } from 'tsoa'
import { ExecutionController, ExecutionVars } from './internal'
import {
getPreProgramVariables,
HTTPHeaders,
LogLine,
makeFilesNamesMap,
getRunTimeAndFilePath
} from '../utils'
@@ -39,7 +37,8 @@ export class STPController {
@Query() _program: string
): Promise<string | Buffer> {
const vars = request.query as ExecutionVars
return execute(request, _program, vars)
return execute(request, _program, vars, undefined, true)
}
/**
@@ -67,7 +66,7 @@ export class STPController {
: null
const otherArgs = { filesNamesMap: filesNamesMap }
return execute(request, program!, vars, otherArgs)
return execute(request, program!, vars, otherArgs, true)
}
}
@@ -75,7 +74,8 @@ const execute = async (
req: express.Request,
_program: string,
vars: ExecutionVars,
otherArgs?: any
otherArgs?: any,
isStp?: boolean
): Promise<string | Buffer> => {
try {
const { codePath, runTime } = await getRunTimeAndFilePath(_program)
@@ -87,7 +87,8 @@ const execute = async (
preProgramVariables: getPreProgramVariables(req),
vars,
otherArgs,
session: req.sasjsSession
session: req.sasjsSession,
isStp
}
)