From b97523e55584cc7d9d682cfeaab8f5b70a10b899 Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Thu, 18 Nov 2021 20:57:56 +0000 Subject: [PATCH] fix: sending _webout as result object in response JSON --- api/package-lock.json | 2 +- api/public/swagger.yaml | 6 +++--- api/src/controllers/internal/Execution.ts | 4 ++-- api/src/controllers/stp.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/package-lock.json b/api/package-lock.json index e03345a..a348767 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -16174,7 +16174,7 @@ "integrity": "sha512-5kCf4TdCVOYve4wSHVTi+db34hknDwvY2C/JVEPHT6T3CkQ5cnwRVPSFz/1WzXzcVvdUi4ag5xd9SDOsU12oWA==" }, "@sasjs/utils": { - "version": "file:../../utils/build/sasjs-utils-5.0.0.tgz", + "version": "file:..\\..\\utils\\build\\sasjs-utils-5.0.0.tgz", "integrity": "sha512-ZSX1oHLEl3Gaz1ILnmbf1hMt3WLfvAddck65BY1NduOePtHx2ioja9CjzXKxB75CphBjLdjR95tbmb8jjzGDZA==", "requires": { "@types/fs-extra": "^9.0.11", diff --git a/api/public/swagger.yaml b/api/public/swagger.yaml index 03e1461..4795851 100644 --- a/api/public/swagger.yaml +++ b/api/public/swagger.yaml @@ -364,7 +364,7 @@ components: type: string log: type: string - result: + _webout: type: string message: type: string @@ -981,7 +981,7 @@ paths: application/json: schema: type: string - description: "Trigger a SAS program using it's location in the _program parameter.\nEnable debugging using the _debug parameter.\nAdditional URL parameters are turned into SAS macro variables.\nAny files provided are placed into the session and\ncorresponding _WEBIN_XXX variables are created." + description: "Trigger a SAS program using it's location in the _program parameter.\r\nEnable debugging using the _debug parameter.\r\nAdditional URL parameters are turned into SAS macro variables.\r\nAny files provided are placed into the session and\r\ncorresponding _WEBIN_XXX variables are created." summary: 'Execute Stored Program, return raw content' tags: - STP @@ -1005,7 +1005,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExecuteReturnJsonResponse' - description: "Trigger a SAS program using it's location in the _program parameter.\nEnable debugging using the _debug parameter.\nAdditional URL parameters are turned into SAS macro variables.\nAny files provided are placed into the session and\ncorresponding _WEBIN_XXX variables are created." + description: "Trigger a SAS program using it's location in the _program parameter.\r\nEnable debugging using the _debug parameter.\r\nAdditional URL parameters are turned into SAS macro variables.\r\nAny files provided are placed into the session and\r\ncorresponding _WEBIN_XXX variables are created." summary: 'Execute Stored Program, return JSON' tags: - STP diff --git a/api/src/controllers/internal/Execution.ts b/api/src/controllers/internal/Execution.ts index c45f40d..c19d2e1 100644 --- a/api/src/controllers/internal/Execution.ts +++ b/api/src/controllers/internal/Execution.ts @@ -53,7 +53,7 @@ export class ExecutionController { program = ` /* runtime vars */ ${varStatments} -filename _webout "${weboutPath}"; +filename _webout "${weboutPath}" mod; /* dynamic user-provided vars */ ${preProgramVarStatments} @@ -111,7 +111,7 @@ ${program}` if (returnJson) { const response: any = { - result: webout + webout: webout } if ((debugValue && debugValue >= 131) || session.crashed) { response.log = log diff --git a/api/src/controllers/stp.ts b/api/src/controllers/stp.ts index ea6e276..632b576 100644 --- a/api/src/controllers/stp.ts +++ b/api/src/controllers/stp.ts @@ -25,7 +25,7 @@ interface ExecuteReturnJsonPayload { interface ExecuteReturnJsonResponse { status: string log?: string - result?: string + _webout?: string message?: string } @@ -120,7 +120,7 @@ const executeReturnJson = async ( ) return { status: 'success', - result: jsonResult.result, + _webout: jsonResult.webout, log: jsonResult.log } } catch (err: any) {