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:
Iván Ovejero
2022-10-05 13:36:09 +02:00
committed by GitHub
parent cc2a2e438b
commit 9089dbe942
39 changed files with 21217 additions and 11086 deletions

View File

@@ -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) {

View File

@@ -74,7 +74,7 @@ export async function prepareUserSettings(): Promise<IUserSettings> {
export async function getEncryptionKey(): Promise<string> {
if (process.env[ENCRYPTION_KEY_ENV_OVERWRITE] !== undefined) {
return process.env[ENCRYPTION_KEY_ENV_OVERWRITE] as string;
return process.env[ENCRYPTION_KEY_ENV_OVERWRITE];
}
const userSettings = await getUserSettings();
@@ -233,7 +233,7 @@ export function getUserSettingsPath(): string {
export function getUserN8nFolderPath(): string {
let userFolder;
if (process.env[USER_FOLDER_ENV_OVERWRITE] !== undefined) {
userFolder = process.env[USER_FOLDER_ENV_OVERWRITE] as string;
userFolder = process.env[USER_FOLDER_ENV_OVERWRITE];
} else {
userFolder = getUserHome();
}