import { getNodeProfile } from '../env/nodeProfile'; import { uploadFile } from './httpRequestUtil'; import { getUserSession } from './loginUtil'; export async function uploadAttachment(party: string, role: string, attachmentPath: string) { const bash = await getUserSessionAndUploadAttachment(party, role, attachmentPath); return bash; } export async function getUserSessionAndUploadAttachment(party: string, role: string, filePath: string) { const { csrfToken, cookies } = await getUserSession(party, role); const baseUrl = getNodeProfile(party).baseUrl; return await uploadFile(cookies, csrfToken, baseUrl, filePath); }