chore: lint

This commit is contained in:
karishmas6
2024-10-13 04:56:41 +05:30
parent 5390931019
commit c7fd9b6e1c

View File

@@ -11,41 +11,41 @@ import { getDecryptedProxyConfig } from "../../routes/proxy";
async function createWorkflowAndStoreMetadata(id: string, userId: string) {
try {
const recording = await Robot.findOne({
where: {
'recording_meta.id': id
},
raw: true
});
const recording = await Robot.findOne({
where: {
'recording_meta.id': id
},
raw: true
});
if (!recording || !recording.recording_meta || !recording.recording_meta.id) {
return {
success: false,
error: 'Recording not found'
};
}
if (!recording || !recording.recording_meta || !recording.recording_meta.id) {
return {
success: false,
error: 'Recording not found'
};
}
const proxyConfig = await getDecryptedProxyConfig(userId);
let proxyOptions: any = {};
const proxyConfig = await getDecryptedProxyConfig(userId);
let proxyOptions: any = {};
if (proxyConfig.proxy_url) {
proxyOptions = {
server: proxyConfig.proxy_url,
...(proxyConfig.proxy_username && proxyConfig.proxy_password && {
username: proxyConfig.proxy_username,
password: proxyConfig.proxy_password,
}),
};
}
if (proxyConfig.proxy_url) {
proxyOptions = {
server: proxyConfig.proxy_url,
...(proxyConfig.proxy_username && proxyConfig.proxy_password && {
username: proxyConfig.proxy_username,
password: proxyConfig.proxy_password,
}),
};
}
const browserId = createRemoteBrowserForRun({
browser: chromium,
launchOptions: {
const browserId = createRemoteBrowserForRun({
browser: chromium,
launchOptions: {
headless: true,
proxy: proxyOptions.server ? proxyOptions : undefined,
}
});
const runId = uuid();
}
});
const runId = uuid();
const run = await Run.create({
status: 'Scheduled',