perf(tooling): Upgrade to TypeScript 4.8 (#4207)
* ⬆️ Upgrade to TypeScript 4.8 * 🔥 Remove unneeded setting * 📦 Update `package-lock.json` * ⏪ Restore `skipLibCheck` * 📦 Re-update `package-lock.json` * ♻️ Apply feedback * ♻️ Add check to new WhatsApp node * 📦 Update `package-lock.json` * Update package-lock.json * ran `npm run lintfix` Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -964,18 +964,16 @@ export async function requestOAuth2(
|
||||
// Signs the request by adding authorization headers or query parameters depending
|
||||
// on the token-type used.
|
||||
const newRequestOptions = token.sign(requestOptions as clientOAuth2.RequestObject);
|
||||
const newRequestHeaders = (newRequestOptions.headers = newRequestOptions.headers ?? {});
|
||||
// If keep bearer is false remove the it from the authorization header
|
||||
if (oAuth2Options?.keepBearer === false) {
|
||||
// @ts-ignore
|
||||
newRequestOptions?.headers?.Authorization =
|
||||
newRequestHeaders.Authorization =
|
||||
// @ts-ignore
|
||||
newRequestOptions?.headers?.Authorization.split(' ')[1];
|
||||
newRequestHeaders.Authorization.split(' ')[1];
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
if (oAuth2Options?.keyToIncludeInAccessTokenHeader) {
|
||||
Object.assign(newRequestOptions.headers, {
|
||||
// @ts-ignore
|
||||
Object.assign(newRequestHeaders, {
|
||||
[oAuth2Options.keyToIncludeInAccessTokenHeader]: token.accessToken,
|
||||
});
|
||||
}
|
||||
@@ -1030,10 +1028,8 @@ export async function requestOAuth2(
|
||||
);
|
||||
const refreshedRequestOption = newToken.sign(requestOptions as clientOAuth2.RequestObject);
|
||||
|
||||
// @ts-ignore
|
||||
if (oAuth2Options?.keyToIncludeInAccessTokenHeader) {
|
||||
Object.assign(newRequestOptions.headers, {
|
||||
// @ts-ignore
|
||||
Object.assign(newRequestHeaders, {
|
||||
[oAuth2Options.keyToIncludeInAccessTokenHeader]: token.accessToken,
|
||||
});
|
||||
}
|
||||
@@ -1108,6 +1104,7 @@ export async function requestOAuth2(
|
||||
|
||||
// Make the request again with the new token
|
||||
const newRequestOptions = newToken.sign(requestOptions as clientOAuth2.RequestObject);
|
||||
newRequestOptions.headers = newRequestOptions.headers ?? {};
|
||||
|
||||
// @ts-ignore
|
||||
if (oAuth2Options?.keyToIncludeInAccessTokenHeader) {
|
||||
|
||||
Reference in New Issue
Block a user