| 56045 | } else o.body = a |
| 56046 | return o |
| 56047 | } |
| 56048 | function build_request_buildRequest(s, o) { |
| 56049 | const { |
| 56050 | spec: i, |
| 56051 | operation: a, |
| 56052 | securities: u, |
| 56053 | requestContentType: _, |
| 56054 | responseContentType: w, |
| 56055 | attachContentTypeForEmptyPayload: x, |
| 56056 | } = s |
| 56057 | if ( |
| 56058 | ((o = (function build_request_applySecurities({ |
| 56059 | request: s, |
| 56060 | securities: o = {}, |
| 56061 | operation: i = {}, |
| 56062 | spec: a, |
| 56063 | }) { |
| 56064 | const u = { ...s }, |
| 56065 | { authorized: _ = {}, specSecurity: w = [] } = o, |
| 56066 | x = i.security || w, |
| 56067 | C = _ && !!Object.keys(_).length, |
| 56068 | j = a.securityDefinitions |
| 56069 | if ( |
| 56070 | ((u.headers = u.headers || {}), |
| 56071 | (u.query = u.query || {}), |
| 56072 | !Object.keys(o).length || |
| 56073 | !C || |
| 56074 | !x || |
| 56075 | (Array.isArray(i.security) && !i.security.length)) |
| 56076 | ) |
| 56077 | return s |
| 56078 | return ( |
| 56079 | x.forEach((s) => { |
| 56080 | Object.keys(s).forEach((s) => { |
| 56081 | const o = _[s] |
| 56082 | if (!o) return |
| 56083 | const { token: i } = o, |
| 56084 | a = o.value || o, |
| 56085 | w = j[s], |
| 56086 | { type: x } = w, |
| 56087 | C = w['x-tokenName'] || 'access_token', |
| 56088 | L = i && i[C] |
| 56089 | let B = i && i.token_type |
| 56090 | if (o) |
| 56091 | if ('apiKey' === x) { |
| 56092 | const s = 'query' === w.in ? 'query' : 'headers' |
| 56093 | ;((u[s] = u[s] || {}), (u[s][w.name] = a)) |
| 56094 | } else if ('basic' === x) |
| 56095 | if (a.header) u.headers.authorization = a.header |
| 56096 | else { |
| 56097 | const s = a.username || '', |
| 56098 | o = a.password || '' |
| 56099 | ;((a.base64 = Yx(`${s}:${o}`)), |
| 56100 | (u.headers.authorization = `Basic ${a.base64}`)) |
| 56101 | } |
| 56102 | else |
| 56103 | 'oauth2' === x && |
| 56104 | L && |