* Adds the API key and the token * @method enrichKwargs * @private * @memberof StreamClient.prototype * @param {AxiosConfig} kwargs * @return {axios.AxiosRequestConfig}
({ method, token, ...kwargs }: AxiosConfig & { method: axios.Method })
| 623 | * @return {axios.AxiosRequestConfig} |
| 624 | */ |
| 625 | enrichKwargs({ method, token, ...kwargs }: AxiosConfig & { method: axios.Method }): axios.AxiosRequestConfig { |
| 626 | return { |
| 627 | method, |
| 628 | url: this.enrichUrl(kwargs.url, kwargs.serviceName), |
| 629 | data: kwargs.body, |
| 630 | params: { |
| 631 | api_key: this.apiKey, |
| 632 | location: this.group, |
| 633 | ...(kwargs.qs || {}), |
| 634 | }, |
| 635 | headers: { |
| 636 | 'X-Stream-Client': this.userAgent(), |
| 637 | 'stream-auth-type': 'jwt', |
| 638 | Authorization: token, |
| 639 | ...(kwargs.headers || {}), |
| 640 | }, |
| 641 | ...(kwargs.axiosOptions || {}), |
| 642 | }; |
| 643 | } |
| 644 | |
| 645 | /** |
| 646 | * Get the authorization middleware to use Faye with getstream.io |
no test coverage detected