refactor(core): Google service account remove duplicated functions (no-changelog) (#6368)

This commit is contained in:
Michael Kret
2023-06-06 19:19:24 +03:00
committed by GitHub
parent 3a6af3b2a2
commit 05c4229cd7
14 changed files with 134 additions and 719 deletions

View File

@@ -4,18 +4,14 @@ import type {
INodeCredentialTestResult,
} from 'n8n-workflow';
import type { IGoogleAuthCredentials } from '../transport';
import { getAccessToken } from '../transport';
import { getGoogleAccessToken } from '../../../GenericFunctions';
export async function googleApiCredentialTest(
this: ICredentialTestFunctions,
credential: ICredentialsDecrypted,
): Promise<INodeCredentialTestResult> {
try {
const tokenRequest = await getAccessToken.call(
this,
credential.data! as unknown as IGoogleAuthCredentials,
);
const tokenRequest = await getGoogleAccessToken.call(this, credential.data!, 'sheetV2');
if (!tokenRequest.access_token) {
return {
status: 'Error',