mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Remove linting exceptions in nodes-base (no-changelog) (#4944)
This commit is contained in:
@@ -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,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user