From 61c6ce72c83af305040204f75f5403fd6245cd46 Mon Sep 17 00:00:00 2001 From: Damien Dudognon Date: Wed, 5 Mar 2025 11:15:45 +0100 Subject: [PATCH] refactor(bitwarden): rename server location --- .../nodes-base/credentials/BitwardenApi.credentials.ts | 4 ++-- packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nodes-base/credentials/BitwardenApi.credentials.ts b/packages/nodes-base/credentials/BitwardenApi.credentials.ts index a432200afe..f511f10789 100644 --- a/packages/nodes-base/credentials/BitwardenApi.credentials.ts +++ b/packages/nodes-base/credentials/BitwardenApi.credentials.ts @@ -52,8 +52,8 @@ export class BitwardenApi implements ICredentialType { }, }, { - displayName: 'Server Geographies', - name: 'serverLocation', + displayName: 'Region', + name: 'region', type: 'options', default: 'bitwarden.com', options: [ diff --git a/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts b/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts index 1def986a0d..f6c5ebc1d9 100644 --- a/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts @@ -13,10 +13,10 @@ import { NodeApiError } from 'n8n-workflow'; * Return the access token URL based on the user's environment. */ async function getTokenUrl(this: IExecuteFunctions | ILoadOptionsFunctions) { - const { environment, domain, serverLocation } = await this.getCredentials('bitwardenApi'); + const { environment, domain, region } = await this.getCredentials('bitwardenApi'); return environment === 'cloudHosted' - ? `https://identity.${serverLocation}/connect/token` + ? `https://identity.${region}/connect/token` : `${domain}/identity/connect/token`; } @@ -24,9 +24,9 @@ async function getTokenUrl(this: IExecuteFunctions | ILoadOptionsFunctions) { * Return the base API URL based on the user's environment. */ async function getBaseUrl(this: IExecuteFunctions | ILoadOptionsFunctions) { - const { environment, domain, serverLocation } = await this.getCredentials('bitwardenApi'); + const { environment, domain, region } = await this.getCredentials('bitwardenApi'); - return environment === 'cloudHosted' ? `https://api.${serverLocation}` : `${domain}/api`; + return environment === 'cloudHosted' ? `https://api.${region}` : `${domain}/api`; } /**