( request: HttpExecuteRequest, variables: Record<string, string>, )
| 57 | } |
| 58 | |
| 59 | function interpolateRequest( |
| 60 | request: HttpExecuteRequest, |
| 61 | variables: Record<string, string>, |
| 62 | ): HttpExecuteRequest { |
| 63 | return { |
| 64 | method: request.method, |
| 65 | url: interpolate(request.url, variables), |
| 66 | headers: request.headers.map(h => ({ |
| 67 | ...h, |
| 68 | value: interpolate(h.value, variables), |
| 69 | })), |
| 70 | query: request.query.map(q => ({ |
| 71 | ...q, |
| 72 | value: interpolate(q.value, variables), |
| 73 | })), |
| 74 | bodyType: request.bodyType, |
| 75 | body: |
| 76 | request.body !== null |
| 77 | ? interpolate(request.body, variables) |
| 78 | : request.body, |
| 79 | formData: request.formData.map(entry => ({ |
| 80 | key: entry.key, |
| 81 | type: entry.type, |
| 82 | value: |
| 83 | entry.type === 'text' |
| 84 | ? interpolate(entry.value, variables) |
| 85 | : entry.value, |
| 86 | })), |
| 87 | auth: interpolateAuth(request.auth, variables), |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | export function applyAuth( |
| 92 | auth: HttpAuth, |
no test coverage detected