@sasjs/adapter 3.8.3 → 3.8.4
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/index.js +2 -2
- package/node/index.js +2 -2
- package/package.json +1 -1
- package/src/job-execution/FileUploader.ts +13 -0
- package/src/request/RequestClient.ts +20 -0
package/package.json
CHANGED
|
@@ -99,7 +99,20 @@ export class FileUploader extends BaseJobExecutor {
|
|
|
99
99
|
? parseWeboutResponse(res.result, uploadUrl)
|
|
100
100
|
: res.result
|
|
101
101
|
break
|
|
102
|
+
case ServerType.Sasjs:
|
|
103
|
+
if (typeof res.result._webout === 'object') {
|
|
104
|
+
jsonResponse = res.result._webout
|
|
105
|
+
} else {
|
|
106
|
+
const webout = parseWeboutResponse(
|
|
107
|
+
res.result._webout,
|
|
108
|
+
uploadUrl
|
|
109
|
+
)
|
|
110
|
+
jsonResponse = getValidJson(webout)
|
|
111
|
+
}
|
|
112
|
+
break
|
|
102
113
|
}
|
|
114
|
+
} else if (this.serverType === ServerType.Sasjs) {
|
|
115
|
+
jsonResponse = getValidJson(res.result._webout)
|
|
103
116
|
} else {
|
|
104
117
|
jsonResponse =
|
|
105
118
|
typeof res.result === 'string'
|
|
@@ -131,6 +131,26 @@ export class RequestClient implements HttpClient {
|
|
|
131
131
|
} else {
|
|
132
132
|
sasWork = response.log
|
|
133
133
|
}
|
|
134
|
+
} else if (response?.result?.log) {
|
|
135
|
+
//In this scenario we know we got the response from SASJS server
|
|
136
|
+
//Log is array of `{ line: '' }` so we need to convert it back to text
|
|
137
|
+
//To be able to parse it with current functions.
|
|
138
|
+
let log: string = ''
|
|
139
|
+
|
|
140
|
+
if (typeof log !== 'string') {
|
|
141
|
+
log = response.result.log
|
|
142
|
+
.map((logLine: any) => logLine.line)
|
|
143
|
+
.join('\n')
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
sourceCode = parseSourceCode(log)
|
|
147
|
+
generatedCode = parseGeneratedCode(log)
|
|
148
|
+
|
|
149
|
+
if (response?.result?._webout) {
|
|
150
|
+
sasWork = response.result._webout.WORK
|
|
151
|
+
} else {
|
|
152
|
+
sasWork = log
|
|
153
|
+
}
|
|
134
154
|
} else if (response?.result) {
|
|
135
155
|
sourceCode = parseSourceCode(response.result)
|
|
136
156
|
generatedCode = parseGeneratedCode(response.result)
|