mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-10 05:40:06 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa87111f4a | ||
|
|
94967b0f6c |
@@ -152,34 +152,40 @@ export class SASViyaApiClient {
|
|||||||
accessToken,
|
accessToken,
|
||||||
null,
|
null,
|
||||||
true
|
true
|
||||||
).catch(() => null)
|
).catch((err) => err)
|
||||||
})
|
})
|
||||||
|
|
||||||
const results = await Promise.all(promises)
|
const results = await Promise.all(promises)
|
||||||
|
|
||||||
results.forEach((result: any, index: number) => {
|
results.forEach((result: any, index: number) => {
|
||||||
if (result) {
|
if (result && result.body && result.body.details) {
|
||||||
let sysUserId = ''
|
try {
|
||||||
|
const resultParsed = JSON.parse(result.body.details)
|
||||||
|
|
||||||
if (result.log) {
|
if (resultParsed && resultParsed.body) {
|
||||||
const sysUserIdLog = result.log
|
let sysUserId = ''
|
||||||
.split('\n')
|
|
||||||
.find((line: string) => line.startsWith('SYSUSERID='))
|
|
||||||
|
|
||||||
if (sysUserIdLog) {
|
const sysUserIdLog = resultParsed.body
|
||||||
sysUserId = sysUserIdLog.replace('SYSUSERID=', '')
|
.split('\n')
|
||||||
|
.find((line: string) => line.startsWith('SYSUSERID='))
|
||||||
|
|
||||||
|
if (sysUserIdLog) {
|
||||||
|
sysUserId = sysUserIdLog.replace('SYSUSERID=', '')
|
||||||
|
|
||||||
|
executableContexts.push({
|
||||||
|
createdBy: contextsList[index].createdBy,
|
||||||
|
id: contextsList[index].id,
|
||||||
|
name: contextsList[index].name,
|
||||||
|
version: contextsList[index].version,
|
||||||
|
attributes: {
|
||||||
|
sysUserId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
throw error
|
||||||
}
|
}
|
||||||
|
|
||||||
executableContexts.push({
|
|
||||||
createdBy: contextsList[index].createdBy,
|
|
||||||
id: contextsList[index].id,
|
|
||||||
name: contextsList[index].name,
|
|
||||||
version: contextsList[index].version,
|
|
||||||
attributes: {
|
|
||||||
sysUserId
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user