@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/SASjsApiClient.d.ts +1 -1
- package/index.js +2 -2
- package/node/SASjsApiClient.d.ts +1 -1
- package/node/index.js +2 -2
- package/package.json +1 -1
- package/src/SASjsApiClient.ts +18 -7
package/package.json
CHANGED
package/src/SASjsApiClient.ts
CHANGED
|
@@ -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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
/**
|