( item: UnknownRecord, folderId: string | null, context: PostmanContext, source: string, warnings: HttpImportWarning[], )
| 275 | } |
| 276 | |
| 277 | function parseRequest( |
| 278 | item: UnknownRecord, |
| 279 | folderId: string | null, |
| 280 | context: PostmanContext, |
| 281 | source: string, |
| 282 | warnings: HttpImportWarning[], |
| 283 | ): HttpImportRequest | null { |
| 284 | if (!isRecord(item.request)) { |
| 285 | return null |
| 286 | } |
| 287 | |
| 288 | const request = item.request |
| 289 | const method = normalizeHttpMethod(request.method, source, warnings) |
| 290 | if (!method) { |
| 291 | return null |
| 292 | } |
| 293 | |
| 294 | const url = parseUrl(request.url) |
| 295 | const headers = normalizeEntries( |
| 296 | parseHeaders(request.header), |
| 297 | source, |
| 298 | warnings, |
| 299 | ) |
| 300 | const auth = resolveAuthConflict( |
| 301 | headers, |
| 302 | parseAuth(request.auth, source, warnings) ?? context.auth, |
| 303 | source, |
| 304 | warnings, |
| 305 | ) |
| 306 | const body = parseBody(request.body, source, warnings) |
| 307 | const parts = createEmptyRequestParts() |
| 308 | |
| 309 | return { |
| 310 | ...parts, |
| 311 | ...body, |
| 312 | auth, |
| 313 | description: asString(request.description), |
| 314 | folderId, |
| 315 | headers, |
| 316 | method, |
| 317 | name: normalizeImportName(item.name, 'Imported request'), |
| 318 | query: normalizeEntries(url.query, source, warnings), |
| 319 | sourceId: asString(item.id || item._postman_id) || undefined, |
| 320 | url: url.url, |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | function walkItems( |
| 325 | items: unknown[], |
no test coverage detected