@sasjs/adapter 3.9.0 → 3.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -79,5 +79,5 @@
79
79
  "https": "1.0.0",
80
80
  "tough-cookie": "4.0.0"
81
81
  },
82
- "version": "3.9.0"
82
+ "version": "3.9.1"
83
83
  }
@@ -62,8 +62,8 @@ export class SASjsApiClient {
62
62
 
63
63
  /**
64
64
  * Executes code on a SASJS server.
65
- * @param serverUrl - a server url to execute code.
66
65
  * @param code - a string of code to execute.
66
+ * @param authConfig - an object for authentication.
67
67
  */
68
68
  public async executeScript(code: string, authConfig?: AuthConfig) {
69
69
  let access_token = (authConfig || {}).access_token
@@ -74,12 +74,23 @@ export class SASjsApiClient {
74
74
  ServerType.Sasjs
75
75
  ))
76
76
  }
77
- const response = await this.requestClient.post(
78
- 'SASjsApi/code/execute',
79
- { code },
80
- access_token
81
- )
82
- return response.result as string
77
+
78
+ let parsedSasjsServerLog = ''
79
+
80
+ await this.requestClient
81
+ .post('SASjsApi/code/execute', { code }, access_token)
82
+ .then((res: any) => {
83
+ if (res.result?.log) {
84
+ parsedSasjsServerLog = res.result.log
85
+ .map((logLine: any) => logLine.line)
86
+ .join('\n')
87
+ }
88
+ })
89
+ .catch((err) => {
90
+ parsedSasjsServerLog = err
91
+ })
92
+
93
+ return parsedSasjsServerLog
83
94
  }
84
95
 
85
96
  /**