I wasn´t sure about what to return from getHeader so I used the Record<string, any> that ApiHeaders is based on instead of the actual ApiHeaders since these seemed to be meant for language and continuation.
I made getHeaders into a promise like getAccessToken. I guess that probably wouldn´t be necessary for most wanting to pass custom headers (cookies) along, but I thought it might as well be the same as getAccessToken. Since both are promises, I suppose they could be run in parallell but it seems unlikely that both getAccessToken and getHeaders would be used together so I simply ran them in serial.
In this implementation config.getHeaders is run after the headers parameter is iterated, so any headers present in both would be overwritten by config.getHeaders.
I wasn´t sure about what to return from getHeader so I used the Record<string, any> that ApiHeaders is based on instead of the actual ApiHeaders since these seemed to be meant for language and continuation.
I made getHeaders into a promise like getAccessToken. I guess that probably wouldn´t be necessary for most wanting to pass custom headers (cookies) along, but I thought it might as well be the same as getAccessToken. Since both are promises, I suppose they could be run in parallell but it seems unlikely that both getAccessToken and getHeaders would be used together so I simply ran them in serial.
In this implementation config.getHeaders is run after the headers parameter is iterated, so any headers present in both would be overwritten by config.getHeaders.
Closes #26