refactor(core): Remove linting exceptions in nodes-base (no-changelog) (#4944)

This commit is contained in:
Michael Kret
2023-01-13 19:11:56 +02:00
committed by GitHub
parent d7732ea150
commit 6608e69457
254 changed files with 2687 additions and 2675 deletions

View File

@@ -9,6 +9,26 @@ import {
import { OptionsWithUri } from 'request';
/**
* Return the access token URL based on the user's environment.
*/
async function getTokenUrl(this: IExecuteFunctions | ILoadOptionsFunctions) {
const { environment, domain } = await this.getCredentials('bitwardenApi');
return environment === 'cloudHosted'
? 'https://identity.bitwarden.com/connect/token'
: `${domain}/identity/connect/token`;
}
/**
* Return the base API URL based on the user's environment.
*/
async function getBaseUrl(this: IExecuteFunctions | ILoadOptionsFunctions) {
const { environment, domain } = await this.getCredentials('bitwardenApi');
return environment === 'cloudHosted' ? 'https://api.bitwarden.com' : `${domain}/api`;
}
/**
* Make an authenticated API request to Bitwarden.
*/
@@ -106,26 +126,6 @@ export async function handleGetAll(
}
}
/**
* Return the access token URL based on the user's environment.
*/
async function getTokenUrl(this: IExecuteFunctions | ILoadOptionsFunctions) {
const { environment, domain } = await this.getCredentials('bitwardenApi');
return environment === 'cloudHosted'
? 'https://identity.bitwarden.com/connect/token'
: `${domain}/identity/connect/token`;
}
/**
* Return the base API URL based on the user's environment.
*/
async function getBaseUrl(this: IExecuteFunctions | ILoadOptionsFunctions) {
const { environment, domain } = await this.getCredentials('bitwardenApi');
return environment === 'cloudHosted' ? 'https://api.bitwarden.com' : `${domain}/api`;
}
/**
* Load a resource so that it can be selected by name from a dropdown.
*/
@@ -138,7 +138,7 @@ export async function loadResource(this: ILoadOptionsFunctions, resource: string
data.forEach(({ id, name, externalId }: { id: string; name: string; externalId?: string }) => {
returnData.push({
name: externalId || name || id,
name: externalId ?? name ?? id,
value: id,
});
});